效果图如下:
实现步骤:
1,在storyboard中拖入一个TableViewController,同时创建一个对应的类(MyTabelViewController.swift)进行绑定。
2,选择表格,在属性面板中设置Content为Static Cells,Sections设置为2
3,选中第1个Sections,将Rows设置为1,并拖入一个TextFiled到单元格中
4,选中第2个
Sections,将Rows设置为2,分别给两个单元格拖入对应的Label和Switch等控件
5,MyTabelViewController.swift
|
class@H_403_43@
@H_403_43@
.tableView.tableFooterView =@H_403_43@
UIView@H_403_43@
didReceiveMemoryWarning() {@H_403_43@
.didReceiveMemoryWarning()@H_403_43@
}@H_403_43@
/**
其实在该demo中,如下2个代理方法不用书写的
如果在故事版中是单独的没有与其他控制器有关联的控制器的初始化需要使用如下方法
let controller:TableController = UIStoryboard.init(name:"Main",bundle: NSBundle.mainBundle()).instantiateViewControllerWithIdentifier("TableController") as! TableController; self.presentViewController(controller,animated: true,completion: nil);
*/
numberOfSectionsInTableView(tableView:@H_403_43@
UITableView@H_403_43@
}@H_403_43@
1@H_403_43@
2@H_403_43@
}@H_403_43@
}@H_403_43@
}@H_403_43@
|