中間是用UITableView實現的。
最下面就是UILabel。
UITableView 的 dataSource 委托裏有
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView; 這個方法。默認是返回1,上面那個界面有兩組,是返回2.
這個方法設置每個每組裏面有兩個子項。
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
然後用這個方法來定制每個項的內容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
百度壹下 UITableView 能找到很多的代碼,這裏就不復制了,自己解決問題會記得比較牢固。