Shinigamae
Shinigamae

Reputation: 862

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 :)

Upvotes: 7

Views: 11831

Answers (1)

jimpic
jimpic

Reputation: 5520

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.

Upvotes: 24

Related Questions