Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a UITableViewCell with a accessorytype detail indicator. When I resize the cell, the cells accessory centers itself horizontally. How can I make it stay on top, and not center itself?
Objective-C
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    customCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellID" forIndexPath:indexPath];

    return cell;
}

I'd prefer doing it in the storyboard if possible, if not, I'm happy to hear how to do it programatically.

I tried doing like this:
Objective-C
CGRect accessoryFrame = cell.accessoryView.frame;
accessoryFrame.origin.y = 10;
cell.accessoryView.frame = accessoryFrame;

But it didn't work.
Posted

1 solution

you must create a own accessory cell as subview and position it on the place. Use Autolayout.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900