关于TableView Cell的一些设置
2015-07-15 09:57
573 查看
TableView 的 separatorStyle 设置是否有线 风格
一、设置Cell底部线 的位置
自定义Cell内
self.separatorInset = UIEdgeInsetsZero;
if ([self respondsToSelector:@selector(setLayoutMargins:)])
{
[self setLayoutMargins:UIEdgeInsetsZero];
}
if ([self respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)])
{
[self setPreservesSuperviewLayoutMargins:NO];
}
二、Cell右视图
系统自带的几种类型
self.accessoryType =
自定义Cell右边视图
self.accessoryView = 自定义一个UIView
三、设置Cell 被选中时的样式
self.selectionStyle = UITableViewCellSelectionStyleNone;
四、设置Cell的高度
+(CGFloat)cellHeight
{
ios8以上编译
/*
([[[UIDevice currentDevice] systemVersion] compare:@“8” options:NSNumericSearch] != NSOrderedAscending)
*/
if (ios8AndUper)
{
return
UITableViewAutomaticDimension;
}
}
一、设置Cell底部线 的位置
自定义Cell内
self.separatorInset = UIEdgeInsetsZero;
if ([self respondsToSelector:@selector(setLayoutMargins:)])
{
[self setLayoutMargins:UIEdgeInsetsZero];
}
if ([self respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)])
{
[self setPreservesSuperviewLayoutMargins:NO];
}
二、Cell右视图
系统自带的几种类型
self.accessoryType =
自定义Cell右边视图
self.accessoryView = 自定义一个UIView
三、设置Cell 被选中时的样式
self.selectionStyle = UITableViewCellSelectionStyleNone;
四、设置Cell的高度
+(CGFloat)cellHeight
{
ios8以上编译
/*
([[[UIDevice currentDevice] systemVersion] compare:@“8” options:NSNumericSearch] != NSOrderedAscending)
*/
if (ios8AndUper)
{
return
UITableViewAutomaticDimension;
}
}
相关文章推荐
- Spring MVC - MultipartFile实现文件上传(单文件与多文件上传)
- NodeMCU上通过DS18b20采集室温
- 一些經典的ORACLE性能管理腳本(一)
- 配置OpenStack的glance出现错误Failed to show index. Got error: You are not authenticated.
- jodd-servlet工具集锦
- C#与mysql做ASP.NET网页数据库查询速度测试
- 什么是Bootstrap
- ios xcode6 创建分类和延展
- Android 打印文件名、函数名、行号
- Error: MediaPlayer start called in state 1 & 64
- eclipse中修改tomcat的启动超时时间
- [LeetCode][Java] N-Queens
- Step into Kotlin - 13 - 包
- 还使用SVN1.6版本的Android开发者注意了。ADT与SVN的兼容性错误。ADT更新的高发性问题
- 文章标题
- JavaScript在html中的引用方式
- 删除src值为空的img标签
- JAVA面试中问及HIBERNATE与 MYBATIS的对比,在这里做一下总结
- uva 12436 Rip Van Winkle's Code 区间更新区间查询
- C# Winform应用程序调用Microsoft RDP client control实现远程连接(VS2013)