如何使用Swift 3在ios 9中设计表单布局
我正在尝试在ios 9中设计表单布局。 我尝试使用UITableViewController静态单元格 这正是我想要的布局 我在ui表视图控制器中使用带有多个部分的静态单元格来完成此操作 但是,一旦我将一个类附加到此UITableViewController,视图就会在运行时消失,无法理解,UITableViewController类的代码是由xcode生成的默认代码 我应该修改类的代码吗 或者我应该采取不同的方法 请帮忙 班级代码如何使用Swift 3在ios 9中设计表单布局,ios,swift,uitableview,Ios,Swift,Uitableview,我正在尝试在ios 9中设计表单布局。 我尝试使用UITableViewController静态单元格 这正是我想要的布局 我在ui表视图控制器中使用带有多个部分的静态单元格来完成此操作 但是,一旦我将一个类附加到此UITableViewController,视图就会在运行时消失,无法理解,UITableViewController类的代码是由xcode生成的默认代码 我应该修改类的代码吗 或者我应该采取不同的方法 请帮忙 班级代码 import UIKit class BasicTable
import UIKit
class BasicTableViewController: UITableViewController {
@IBOutlet var basicTableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = false
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
// MARK: - Table view data source
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 6
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 0
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
return cell
}
完全删除此方法
override func tableView(tableView:UITableView,numberofrowsinssection:Int)->Int{
通常仅在显示动态单元格时保留此方法,它会告诉表视图有多少行要出列(显示给您)需要查看一些代码,因为使用带有静态单元格的表视图是正确的方法。请您指导我。ios应用程序开发的新功能使用表视图方法显示您的代码是默认代码。仅使用x代码生成我更改了部分的编号,并添加了Uitable视图作为输出