UIModalTransitionStylePartialCurl forces UIButton text to be updated

I have a UIView that is used in a modal view using the UIModalTransitionStylePartialCurl transition style when it appears. This UIView includes UIButton. It is strange that whenever a view appears, when the main page is cleared to the top of the window, the button in the modal view enlivens itself, and the text seems to be typed onto the button from the center of itself. The movement of this animation is a little distracting.

Why is this happening? Is there any way to prevent this?

UIButton uses its own background, but it is defined in XIB for modal representation and does not use any special subclass. This is a standard button.

+6
source share
2 answers

I had the same problem and the autoresizingMask code mentioned did not work for me. Although it gave me a few pointers in which direction I should look. Basically, the view that will be displayed should be โ€œdrawnโ€ before showing its initial placement. Prior to iOS 5, this was automatically done for animations, including page curl, but iOS 5 broke it. But adding forced โ€œdrawingโ€ directly to viewDidLoad allowed this for me!

- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. [self.view layoutIfNeeded]; } 
+12
source

Although in this post I offer my answer to this problem. the PHO patch proposed later in this thread is cleaner. Thanks, PHO! :)

0
source

Source: https://habr.com/ru/post/905041/


All Articles