小编Zah*_*ill的帖子

SWIFT UITableview根据内容设置autoheight - XCode - iOS

UITableView根据内容动态自动调整高度.我尝试了以下解决方案,但对我不起作用:

dispatch_async(dispatch_get_main_queue()) {
        //This code will run in the main thread:
        CGRect frame = self.tableView.frame;
        frame.size.height = self.tableView.contentSize.height;
        self.tableView.frame = frame;
    }
Run Code Online (Sandbox Code Playgroud)

资源

xcode uitableview ios swift

3
推荐指数
1
解决办法
6731
查看次数

标签 统计

ios ×1

swift ×1

uitableview ×1

xcode ×1