您的位置:首页 > 其它

关于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;
    }       
}

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: