Iphone 使用UITableViewCellAccessoryDisclosureIndicator显示标签
我希望显示标签如下 因此,我使用下面的代码显示带有UITableViewCellAccessorExposureIndicator的标签Iphone 使用UITableViewCellAccessoryDisclosureIndicator显示标签,iphone,Iphone,我希望显示标签如下 因此,我使用下面的代码显示带有UITableViewCellAccessorExposureIndicator的标签 cell=[[[UITableViewCell alloc] initWithFrame:CGRectZero// cellframe //SimpleTableIdentifier1 reuseIdentifier:SimpleTableIdentifier1] autorelease]; ce
cell=[[[UITableViewCell alloc] initWithFrame:CGRectZero// cellframe //SimpleTableIdentifier1
reuseIdentifier:SimpleTableIdentifier1] autorelease];
cell.accessoryType= UITableViewCellAccessoryDisclosureIndicator;//
UILabel *labelCell =[ [[UILabel alloc]init] autorelease];
[labelCell setTag:11101];
labelCell.frame = CGRectMake(180.9f,15.0f,60.0f,23.0f) ;
[labelCell setBackgroundColor:[UIColor clearColor]];
labelCell.textAlignment=UITextAlignmentRight;
[labelCell setFont:[UIFont systemFontOfSize:13.0]];
[labelCell setTextColor:[UIColor blackColor]];
[cell.contentView addSubview:labelCell];
UITableViewCellAccessoryDisclosureIndicator将正确显示
但是labelCell不会显示,除非我点击UITaskBleViewCell的行
欢迎任何评论更改
UILabel的框架属性
,
尝试更改x和y的值
labelCell.frame = CGRectMake(180.9f,15.0f,60.0f,23.0f) ;
您还可以考虑使用<代码>附件/视图> />代码>附件> < /P>
不知何故,我认为这样做
[cell.contentView bringSubviewToFront:labelCell];
这将有所帮助,但由于表格单元格中还有其他子视图,因此您也必须处理它们的布局。相反,我建议您创建一个新的自定义
UITableViewCell
子类。您是说它是10和15,但显示为10和5?@monsabre这个问题仍然存在吗?