资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

iOSUITableView中系统分隔线的使用

//设置分割线的左右对齐
   if([_myTableView respondsToSelector:@selector(setSeparatorInset:)]){
       [_myTableView setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)];
    }
//设置分割线的颜色
   if([_myTableView respondsToSelector:@selector(setSeparatorColor:)]){
       [_myTableView setSeparatorColor:[UIColor grayColor]];
     }
//隐藏分割线
       _myTableView.separatorStyle = NO;
//去掉多余的分割线 
      _myTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
#pragma mark-once 分割线 8.0以下的方法
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) {
        [tableView setSeparatorInset:UIEdgeInsetsZero];
    }
    
    if ([tableView respondsToSelector:@selector(setLayoutMargins:)]) {
        [tableView setLayoutMargins:UIEdgeInsetsZero];
    }
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
}

今天复习了下UITableVie分割线的用法,看了设置分割线毛玻璃的效果,发现并没有明显突出的亮点,只是变模糊了,改颜色也没有啥用。

创新互联公司从2013年成立,是专业互联网技术服务公司,拥有项目网站设计、成都网站制作网站策划,项目实施与项目整合能力。我们以让每一个梦想脱颖而出为使命,1280元瀍河做网站,已为上家服务,为瀍河各地企业和个人服务,联系电话:028-86922220

基本分割线很常用,随着系统的升级有些方法不兼容,要我时常兼容之前的版本,基本都是系统的或者就是自定义定义一个UIView设置1px这样做。


分享文章:iOSUITableView中系统分隔线的使用
网站地址:http://cdkjz.cn/article/pjiedh.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220