繁体   English   中英

连接到表视图控制器时,Swift静态表视图消失

[英]Swift static table view disappears when connected to table view controller

我在我的主故事板中创建了一个简单的静态表视图,但每次我连接一个空白的UITableViewController时,静态视图都没有加载。

它应该看起来像这样(没有连接控制器文件)连接时它看起来像这样

从UITableViewController子类中删除numberOfSectionsInTableView()tableView(numberOfRowsInSection:)的默认实现。

即删除那些方法,因为它们返回0:

func numberOfSectionsInTableView(tableView: UITableView) -> Int {
    return 0
}

func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return 0
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM