iOS: Using modal pageFlip makes strange cell animation in UITableViewController
Asked Answered
G

2

1

I wanted to show a Settings view, so I figured I could use the pageCurl modal style. I have a UIViewController that I am presenting from:

Settings *settings = [[[Settings alloc] initWithStyle:UITableViewStyleGrouped] autorelease];
settings.view.backgroundColor = [UIColor scrollViewTexturedBackgroundColor];
settings.modalTransitionStyle = UIModalTransitionStylePartialCurl;
settings.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:settings animated:YES];

When the page curls, to reveal my UITableViewController below, the cells subviews (labels and accessory views) seem to animate into position, which looks horrible:

enter image description here enter image description here enter image description here

The strange thing is, is that the animation never happens to the top cell in a section. This does not happen with other modalTransitionStyle's so I am wondering why this could be happening. It is really becoming frustrating because I cannot figure out how to stop this from happening.

Ideas?

Greaten answered 21/11, 2011 at 7:28 Comment(0)
D
0

If you set the autoResizingMask property of the tableView to UIViewAutoresizingNone, I think this won't happen. This may be a little bug in the page curl animation.

Dumdum answered 29/11, 2011 at 23:28 Comment(1)
No, sadly that didn't seem to help. I am pulling my hair out over this issue.Greaten
V
0

I've noticed that the direction of this weird animation (which also happens to UIButtons), depends on the Alignment chosen in the Control section of the object's Attributes inspector (in Interface Builder). I've been tinkering with all attributes all evening and have found no solution yet. :(

Edit: so, I had three UIButton in my view (and one UIPickerView) that where doing this weird behavior at the same time. I created a property linking to ONE of the UIButtons. Then, in the viewDidLoad of this view's controller I added the following line:

_firstAffectedButton.titleLabel.autoresizingMask = UIViewAutoresizingNone;

And that fixed it for me, for all the buttons and the picker!! :? Weird, right?

Can anyone explain why this is working? I have the feeling I'm doing something stupid to fix this, but I can't see what it is.

Edit 2: Turns out there was a better and cleaner solution to this problem. See this post.

Verge answered 4/2, 2012 at 16:55 Comment(3)
You should really submit a bug-ticket on the Apple radar and another one on OpenRadar.Parotid
I have no idea how to do that. Also, I'm actually quite new to this programming thing, so I'm not confident enough to report something that could be a mistake on my part...Verge
I've just added the second edit to my post with a better solution.Verge

© 2022 - 2024 — McMap. All rights reserved.