我认为ü可以配置乌尔细胞是这样的:
(的UITableViewCell *)的tableView:(UITableView的*)的tableView的cellForRowAtIndexPath:(NSIndexPath *)indexPath { 静态的NSString * CellIdentifier = @ “小区”;
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];
}
CGRect Frame4 = CGRectMake(10.0, 30.0, 50.0, 40.0);
UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
button.frame = Frame4;
[button setTitle:@"Click" forState:UIControlStateNormal];
button.backgroundColor = [UIColor grayColor];
[button addTarget:self
action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:button];
return cell;
}
然后添加按钮操作事件:
请更换“UIButtonTypeDetailDisclosure”乌拉圭回合欲望图像按钮
我认为你必须要通过自定义单元格 –
做到这一点我如何自定义单元格?并访问它? – Thejaswi
@MH babu我不想让我的主人做任何代码更改..我只想直接访问图像视图。而无需将其更改为按钮。这可能吗? – Thejaswi