网站/小程序/APP个性化定制开发,二开,改版等服务,加扣:8582-36016

简单自动布局

应用介绍

    源码SDAutoLayout,一行代码搞定自动布局!致力于做最简单易用的Autolayout库。tableview cell 自动高度设置只需要3步 1. >> 设置cell高度自适应: // cell布局设置好之后调用此方法就可以实现高度自适应(注意:如果用高度自适应则不要再以cell的底边为参照去布局其子view) [cell setupAutoHeightWithBottomView:_view4 bottomMargin:10]; 2. >> 设置 tableview 数据源和代理 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // 2.1 注册模型cell [self.tableView startAutoCellHeightWithCellClass:“cell类名” contentViewWidth:“contentview宽度”]; return _rowCount; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { // 2.2 根据模型取得cell高度 return [self.tableView cellHeightForIndexPath:indexPath model:“model” keyPath:@"model属性名"]; }

    立即下载

    请到会员中心签到后即可获得免费下载!

    相关下载

    评论 共有 0 条评论

    暂无评论
    0
    0
    0
    立即
    投稿
    发表
    评论
    返回
    顶部