UIButton 立即购买效果
我想在我的应用程序中制作一个“立即购买”按钮,其工作方式应与 App Store 中的按钮相同,但我不知道如何使用动画调整 UIButton 的大小。
我尝试了以下操作,但它立即调整了按钮的大小,而不是作为动画:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:10.5];
[buyButton setFrame:CGRectMake(20, 115, 70, 21)];
[UIView commitAnimations];
其中“buyButton”是 UIButton。
我已经检查过这篇文章 UIButton AppStore 购买按钮动画,但似乎没有去工作。
I want to make a "Buy Now" button in my Application, which should work the same way as the one in the App Store, but I dont know how to resize the UIButton with an animation.
I have tried the following, but it resized the button at once and not as an animation:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:10.5];
[buyButton setFrame:CGRectMake(20, 115, 70, 21)];
[UIView commitAnimations];
Where the "buyButton" is a UIButton.
I've checked ou this post UIButton AppStore buy button animation, but is does not seem to work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
使用
CGAffineTransform
可能会有所帮助。我还没有尝试过这个,但是,它应该有效。Try this:
Using
CGAffineTransform
may help. I have not tried this, however, it should work.theapptree.com 上用于应用程序内购买的示例代码应该可以满足您的需求。
http://www.theapptree.com/samples
the sample code on theapptree.com for the inapp purchase should do what you want.
http://www.theapptree.com/samples