zoukankan      html  css  js  c++  java
  • iOS基础(四)——UIButton和UITableView

    1、懒加载button

    -(UIButton *)button{
        if (!_button) {
            _button = ({
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                [button setTitle:@"内容显示" forState:UIControlStateNormal];
                button.titleLabel.font = [UIFont systemFontOfSize:14];
                [button addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
                button;
            });
        }
        return _button;
    }
    

    2、懒加载tableview

    -(UITableView *)tableView
    {
        if (!_tableView) {
            _tableView = ({
                UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectZero style:UITableViewStylePlain];
                tableView.dataSource = self;
                tableView.delegate = self;
                tableView.backgroundColor = [UIColor whiteColor];
                //设置分割线样式
                tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
                //tableview弹跳效果
                tableView.bounces=YES;
                //隐藏滚动条
                tableView.showsVerticalScrollIndicator = NO ;
                //隐藏底部多余分割线
                tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
                tableView ;
            }) ;
        }
        
        return _tableView;
    }
    
  • 相关阅读:
    第二阶段站立会议03
    第二阶段站立会议02
    第二阶段站立会议01
    第十一周进度条
    小强大扫荡
    测试计划
    用户体验
    各组意见
    第一阶段绩效评估
    站立会议10
  • 原文地址:https://www.cnblogs.com/smileK/p/9554128.html
Copyright © 2011-2022 走看看