Buttons are grouped by UIButton

I am trying to create a button configured just like this:

alt text

How should I do it? Can someone show me the code? Is there a way for "group" UIButtons like this?

+3
source share
3 answers

You want to use UITableViewControllerwith partitions set as UITableViewStyleGrouped.

Each of the groups is a section, so you will want to return the number of sections with - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView.

For each section, you want to indicate how many lines there are with - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section.

You want to customize each cell with - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath(which, by the way, tells you how much of a particular row you are changing in a variable indexPath).

, - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath, XCode :

[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];

, !

+9

UITableView (). - UITableViewStyleGrouped. , –tableView:didSelectRowAtIndexPath:, UIButtons - .

+1

uibuttons. , uitableview. , , , , . , ...

0

Source: https://habr.com/ru/post/1783291/


All Articles