DonDyck
DonDyck

Reputation: 1471

Placement of detail disclosure indicator

I am using a disclosureindicator to show detail description of my tableview cells. I use

[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]

to invoke the system indicator. My question is how can I customize the placement? Currently it is ~10 px from right and I would like to place it 20 px from right margin of the screen. Can I set it programmatically or I have to place a custom image? Help would be appreciated. Thanks.

Upvotes: 2

Views: 3512

Answers (2)

Chris Nolet
Chris Nolet

Reputation: 9063

In iOS 8 you can play with layoutMargins:

- (void)viewDidLoad
{
    [super viewDidLoad];

    UIEdgeInsets layoutMargins = self.tableView.layoutMargins;
    layoutMargins.right = 20.0f;

    self.tableView.layoutMargins = layoutMargins;
}

Upvotes: 2

Alex Wayne
Alex Wayne

Reputation: 187054

If you don't like the standard view placements, you will have make your own assets and place them yourself using IB or with:

[cell addSubView:myCustomDisclosureView];

Upvotes: 1

Related Questions