zoukankan      html  css  js  c++  java
  • UITableView-常见设置

    UITableView的常见设置

    // 分割线颜色
    self.tableView.separatorColor = [UIColor redColor];
    
    // 隐藏分割线
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    // tableView有数据的时候才需要分割线
    // 开发小技巧:快速取消分割线
     self.tableView.tableFooterView = [[UIView alloc] init];

    UITableViewCell的常见设置

    // 取消选中的样式(常用) 让当前 cell 按下无反应
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    // 设置选中的背景色
    UIView *selectedBackgroundView = [[UIView alloc] init];
    selectedBackgroundView.backgroundColor = [UIColor redColor];
    cell.selectedBackgroundView = selectedBackgroundView;
    
    // 设置默认的背景色
    cell.backgroundColor = [UIColor blueColor];
    
    // 设置默认的背景色
    UIView *backgroundView = [[UIView alloc] init];
    backgroundView.backgroundColor = [UIColor greenColor];
    cell.backgroundView = backgroundView;
    
    // backgroundView的优先级 > backgroundColor
    // 设置指示器
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.accessoryView = [[UISwitch alloc] init];
  • 相关阅读:
    MyBaits基本要素
    自定义MVC
    mybatis之多个对象自动装配问题
    idea之映射servlet问题
    idea工程jdk设置问题
    初识多线程之基础知识与常用方法
    多线程之模拟数据库连接
    mybatis配置文件详解
    初识mybatis之入门案例
    mybatis中打印sql语句
  • 原文地址:https://www.cnblogs.com/luoze/p/5467595.html
Copyright © 2011-2022 走看看