g_fred
g_fred

Reputation: 6028

UITableViewCell accessory not positioned correctly after rotating UITableView on iPad

I have an iPhone app that I've converted to a universal app.

The app works fine in all orientation on the iPhone. However on iPad when I rotate a table view, the UITableViewCell accessory is not repositioned correctly (see images below). I'm using a standard UITableViewCell of type UITableViewCellStyleSubtitle. The rest of view is drawn correctly and uses all the iPad real estate. The XIB files are the same for the iPad and iPhone, except for the MainWindow.xib.

After scrolling down and backup, the accessory are redrawn at the correct position.

Does anyone know what could be causing that issue?

EDIT: If I remove the index list on the right, the problem disappears!

Portrait orientation:

alt text

And when I rotate to landscape:

alt text

After scrolling down 2 cells and up again, the cell is refreshed and the accessory drawn at the correct position:

alt text

Upvotes: 0

Views: 1027

Answers (2)

Wheelie
Wheelie

Reputation: 3916

I had the same problem and the problem was I wasn't calling the base implementation of LayoutSubviews, s described here:

UITableViewCell accessory chevron not right-aligning in iOS7

Upvotes: 0

Shaggy Frog
Shaggy Frog

Reputation: 27601

This very well could be a bug and I'd recommend you file a bug report at https://bugreport.apple.com/

But for what it's worth, I don't think you should use a disclosure indicator along with an index -- none of the Apple apps feature this pattern. I was doing this myself until I noticed how Apple avoided it.

Upvotes: 1

Related Questions