UIModalTransitionStylePartialCurl 导致 UIButton 文本动画
我有一个 UIView,它在出现时使用 UIModalTransitionStylePartialCurl 过渡样式在模态视图中使用。该 UIView 包含一个 UIButton。奇怪的是,每当视图出现时,当主页面剥离到窗口顶部时,模式视图上的按钮会自行动画,文本似乎是从其中心输入到按钮上的。这个动画的动作有点分散注意力。
为什么会出现这种情况?有什么办法可以预防吗?
UIButton 确实使用了自定义背景,但它是在模式视图的 XIB 中定义的,并且不使用我自己的任何特殊子类。这是一个标准按钮。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我遇到了同样的问题,并且提到的 autoresizingMask 代码对我不起作用。
尽管它确实给了我一些应该朝哪个方向看的指示。
基本上,将出现的视图应该在显示之前“绘制”以进行初始放置。
在 iOS 5 之前,这是自动为动画(包括卷页)完成的,但 IOS 5 打破了它。
但是在 viewDidLoad 中添加强制“绘图”为我解决了这个问题!
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!
虽然在这篇文章我针对这个问题给出我的答案。 本线程稍后提供的补丁 PHO 更干净。谢谢你! :)
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! :)