【发布时间】:2016-02-13 10:19:14
【问题描述】:
我尝试按照教程进行操作,但这是相当老的教程,当您使用应用程序的视图运行应用程序时会出现一些问题。
没有图像,我重建了约束,但没有任何改变。
ViewController 的代码:
class MasterViewController: UIViewController {
@IBOutlet var tableView: UITableView!
@IBOutlet var searchBar: UISearchBar!
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showDetail" {
}
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
if let selectedIndexPath = self.tableView.indexPathForSelectedRow {
self.tableView.deselectRowAtIndexPath(selectedIndexPath, animated: true)
}
}
}
extension MasterViewController: UITableViewDataSource, UITableViewDelegate {
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 0
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
return cell
}
func tableView(tableView: UITableView, canEditRowAtIndexPath indexPath: NSIndexPath) -> Bool {
return true
}
func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
}
}
extension MasterViewController: UISearchBarDelegate {
func searchBarSearchButtonClicked(searchBar: UISearchBar) {
}
}
我怎样才能调整它的大小而不只是为 iPhone 4 (或摆脱黑色区域)?
【问题讨论】:
-
请出示您的代码
-
@OrkhanAlizade,完成!
-
你到底想做什么?
-
@OrkhanAlizade 去除黑色区域