UIModalTransitionStylePartialCurl causing UIButton text to animate
Asked Answered
E

2

6

I've got a UIView that gets used in a modal view using the UIModalTransitionStylePartialCurl transition style when it appears. This UIView includes a UIButton. The odd thing is that whenever the view appears, as the primary page peels up to the top of the window the button on the modal view animates itself, with the text seeming to get typed onto the button from the center of itself. The movement of this animation is a bit distracting.

Why does this happen? Is there any way to prevent it?

The UIButton does use a custom background, but it is defined in the XIB for the modal view and does not use any special subclass of my own. It is a standard button.

Ecclesiastic answered 4/1, 2012 at 2:45 Comment(1)
I just ran into this exact issue. I'm now just trying to come up with the simplest possible workaround.Heartbreaker
G
12

I had the same problem and the mentioned autoresizingMask code didn't work for me. Although it did give me some pointers in which direction I should look. Basically the view that will appear should be 'drawn' before being show to have it's initial placing. Before IOS 5 this was automatically done for the animation including the page-curl, but IOS 5 broke it. But adding the forced 'drawing' yourself at viewDidLoad solved it for me!

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [self.view layoutIfNeeded];
}
Geis answered 5/2, 2012 at 13:1 Comment(0)
R
0

Although in this post I offer my answer for this problem. The patch PHO offered later in this very thread is cleaner. Thank you PHO! :)

Rhiannonrhianon answered 5/2, 2012 at 0:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.