ios uitableviewcell
2016-04-02 09:18
363 查看
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *identifier =
@"ChongZhiViewCell";
ChongZhiViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:identifier];
if (cell == nil) {
cell = [[ChongZhiViewCell
alloc] initWithStyle:(UITableViewCellStyleSubtitle)
reuseIdentifier:identifier];
}
if (indexPath.row ==
0) {
self.imgV = [[UIImageView
alloc] initWithFrame:CGRectMake(8,
8, 40,
40)];
self.imgV.backgroundColor = [UIColor
myColorWithString:@"1E90FF"];
[self.view
addSubview:self.imgV];
self.titleLB = [[UILabel
alloc] initWithFrame:CGRectMake(60,
12, 300,
40)];
self.titleLB.backgroundColor = [UIColor
whiteColor];
self.titleLB.font = [UIFont
systemFontOfSize:15];
self.titleLB.text =
_titleString;
[self.view
addSubview:self.titleLB];
}
if (indexPath.row ==
1) {
cell.titleLB.text =
@"缴费:";
}if (indexPath.row ==
2) {
cell.titleLB.text =
@"户号:";
}
UIButton *button = [UIButton
buttonWithType:(UIButtonTypeCustom)];
button.frame =
CGRectMake(40,
300, 300, 40);
[button.layer
setCornerRadius:10.0];
button.backgroundColor = [UIColor
myColorWithString:@"1E90FF"];
[button setTitle:@"确定"
forState:(UIControlStateNormal)];
[self.view
addSubview:button];
return cell;
}
static NSString *identifier =
@"ChongZhiViewCell";
ChongZhiViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:identifier];
if (cell == nil) {
cell = [[ChongZhiViewCell
alloc] initWithStyle:(UITableViewCellStyleSubtitle)
reuseIdentifier:identifier];
}
if (indexPath.row ==
0) {
self.imgV = [[UIImageView
alloc] initWithFrame:CGRectMake(8,
8, 40,
40)];
self.imgV.backgroundColor = [UIColor
myColorWithString:@"1E90FF"];
[self.view
addSubview:self.imgV];
self.titleLB = [[UILabel
alloc] initWithFrame:CGRectMake(60,
12, 300,
40)];
self.titleLB.backgroundColor = [UIColor
whiteColor];
self.titleLB.font = [UIFont
systemFontOfSize:15];
self.titleLB.text =
_titleString;
[self.view
addSubview:self.titleLB];
}
if (indexPath.row ==
1) {
cell.titleLB.text =
@"缴费:";
}if (indexPath.row ==
2) {
cell.titleLB.text =
@"户号:";
}
UIButton *button = [UIButton
buttonWithType:(UIButtonTypeCustom)];
button.frame =
CGRectMake(40,
300, 300, 40);
[button.layer
setCornerRadius:10.0];
button.backgroundColor = [UIColor
myColorWithString:@"1E90FF"];
[button setTitle:@"确定"
forState:(UIControlStateNormal)];
[self.view
addSubview:button];
return cell;
}
相关文章推荐
- IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2)——A - Bear and Three Balls(unique函数的使用)
- 编程异常——假设你报createSQLQuery is not valid without active transaction,...
- DuiLib(1)——简单的win32窗口
- (NOT OK) How To Build CyanogenMod Android for Motorola Defy ("jordan")
- Microsoft Build 2016之Xamarin 的重磅消息
- js构建ui的统一异常处理方案(二)
- js构建ui的统一异常处理方案(二)
- MySQL-QueryCache查询缓存
- winform 换个皮肤
- UIScrollView控件介绍
- JTouch (Remote GUI) - 最纯粹简约的GUI即时通讯工具
- Build failed in step 'Installing CLooG for host'
- Java的break和continue使用示例
- OC高效率52之不要使用dispatch_get_current_queue
- Your build settings specify a provisioning profile
- 自定义UITableViewCell实现左滑动多菜单功能LeftSwipe
- UiAutomator中android.widget.ListView控件的子元素遍历
- 在Xcode 6.2中遇到Your build settings specify a provisioning profile with the UUID, no provisioning prof
- android项目中values中几个…
- Incorrect string value: '\xC2\x8B\xC3\xA8\xC2\xAF...' for column 'name' at row 1