iPhone效果评论框
我刚刚使用过 Instagram 应用程序。我喜欢点击评论时的效果。 当您单击“评论”时,您将看到插入评论文本的淡入视图。 我怎样才能实现这样的事情?
这里有两个屏幕截图:
I've just used Instagram application. I like the effect when I click on comment.
When you click "comment" you'll see a fade in view for insert the comment text.
How can I implement something like this?
Here two screenshot's:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
设置 UIAnimation。以视图的 alpha 为 0 开始动画,然后以该视图的 alpha 为 1 结束动画,并提交动画。瞧,你的视野会逐渐消失。
这很容易。创建您的视图。当用户单击按钮时,将该视图的 alpha 设置为 0 并将大小设置为小于最终大小等。
假设您的视图名为 myView。你会写:
然后将 alpha 设置为 1 并增加视图的大小
然后你提交动画
是这样的,我是凭空写下来的,所以我对任何语法错误或任何错误表示歉意。但这几乎就是它的完成方式。
Set a UIAnimation. Start the animation with the alpha of the view at 0, and then end the animation with the alpha of that view to 1, and commit the animation. And voila, you have a view that fades in.
It's easy. Create your view. When the user clicks the button, set the alpha of that view to 0 and set the size to smaller than your final size, etc.
lets say your view is called myView. you'd write:
and then you set the alpha to 1 and increase the size of the view
and then you commit the animations
It's something like that, i wrote it off the top of my head so I apologize for any syntax errors or anything. But that's pretty much how it's done.