- (UItableVIEwCell *)tableVIEw:(UItableVIEw *)tableVIEw cellForRowAtIndexPath:(NSIndexPath *)indexPath { UItableVIEwCell* cell = [tableVIEw dequeueReusableCellWithIDentifIEr:@"SwitchCell"]; if (cell==nil){ cell = [[[UItableVIEwCell alloc] initWithFrame:CGRectZero reuseIDentifIEr:@"SwitchCell"] autorelease]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(5,60,30)]; cell.textLabel.text = @"left text"; label.text = @"right text"; cell.accessoryType = UItableVIEwCellAccessorydisclosureIndicator; cell.accessoryVIEw = label; [label release]; } return cell;}
有任何想法吗?谢谢.
解决方法cell.accessoryVIEw = label;
您将accessoryVIEw设置为标签,因此您不会看到任何披露指示.如果你想要你的单元格中的标题和详细文本,那么使用UItableVIEwCellStyleValue2像这样初始化它…
cell = [[[UItableVIEwCell alloc] initWithStyle:UItableVIEwCellStyleValue2 reuseIDentifIEr:@"cellType"] autorelease];
…然后像这样设置标题和细节……
cell.textLabel.text = @"Title";cell.detailTextLabel.text = @"Description";
要了解不同的内置表格样式,请查看以下图像…
您可以调整textLabel和detailTextLabel以适合您的口味.
总结以上是内存溢出为你收集整理的ios – UITableViewCell accessoryView无法显示全部内容,希望文章能够帮你解决ios – UITableViewCell accessoryView无法显示所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)