Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add left indent to UITableView cell

Please refer to this picture below:

Result

I want to customize a UITableView.

I achieved applying image background for it using tableView.backgroundView.

Now I want to add left indent/margin to every row as the example picture. Then I want to reduce their width and centerize them.

Could I achieve these? Any help is appreciated :)

like image 303
Shinigamae Avatar asked Nov 13 '12 10:11

Shinigamae


1 Answers

You could use a transparent view for your cells and center your content inside that cell. Or you can use

- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath

for the indentation part.

like image 151
jimpic Avatar answered Dec 07 '22 00:12

jimpic