Domanda

In Instagram app when you add new photo you can see this table:

enter image description here

How can i create it? Any ideas

È stato utile?

Soluzione

@Eugene its a group table with multiple sections. If you don't know how to create group table then have a look at this tutorial - http://www.mobisoftinfotech.com/blog/iphone/iphone-uitableview-tutorial-grouped-table/

Altri suggerimenti

- (id)initWithFrame:(CGRect)frame style:(UITableViewStyle)style

here you can specify UITableViewStyleGrouped as the style to get the grouped tableview you see..

Table view datasource

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

here you should return the no..of section in the table (above image has 2 sections ..)

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

the above method is used to specify the title for the section..in the above image(first section does not have a title...return "Sharing" for second)

Rest is done in :

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

here you can provide a custom text for the cell...change its font...show accessory in the cells..add images to the cell..

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top