创建纯洁的TableViewCell
2024-08-27 01:06:02
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// 声明静态字符串型对象,用来标记重用单元格
static NSString *str = @"TableSampleIdentifier";
// 用TableSampleIdentifier表示需要重用的单元
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:str];
// 如果如果没有多余单元,则需要创建新的单元
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:str];
}
// 填充行的详细内容
cell.detailTextLabel.text = @"详细内容";
// 表视图单元提供的UILabel属性,设置字体大小
cell.textLabel.font = [UIFont boldSystemFontOfSize:40.0f];
// 设置单元格UILabel属性背景颜色
cell.textLabel.backgroundColor=[UIColor clearColor];
return cell;
}
最新文章
- WINDOWS遠程常規化後再次切換回到全屏
- Swing布局基础
- [转] Android开发者必备的42个链接
- TCP 状态图网摘
- c++之路进阶——bzoj3343(教主的魔法)
- C语言实现strcpy
- hdu-5700 区间交(二分+树状数组)
- Oracle-11g-R2(11.2.0.3.x)RAC Oracle Grid &; Database 零宕机方式回滚 PSU(自动模式)
- Python算术运算符
- python学习Processing
- sql 练习(2)
- c#Enum的用法
- 数据处理:12个使得效率倍增的pandas技巧
- 转 html5离线储存,application cache,manifest使用体验
- DeprecationWarning: Calling an asynchronous function without callback is deprecated. - how to find where the “function:” is?
- [leetcode]Unique Paths @ Python
- 面向切面编程AOP,一些通用装饰器
- jquery中的ajax请求,阻塞ui线程的解决方案(自己总结的demo)
- python变量作用域,函数与传参
- 如何让docker以daemon方式运行/bin/bash