让UILabel提示文字动起来
2016-05-26 18:18
330 查看
当用一个UILabel或者其他作为提示输入错误信息的时候,为了使错误信息引起用户注意,可以采取增加一个动画效果,例如:
[objc]
view plain
copy
print?
[UIView animateWithDuration:.1 animations:^{
self.errorLabel.alpha = 0.0;
} completion:^(BOOL finished) {
[UIView animateWithDuration:.1 animations:^{
self.errorLabel.alpha = 1.0;
self.errorLabel.text = @"密码或用户名错误,请重试!";
} completion:^(BOOL finished) {
}];
}];
[objc]
view plain
copy
print?
[UIView animateWithDuration:.1 animations:^{
self.errorLabel.alpha = 0.0;
} completion:^(BOOL finished) {
[UIView animateWithDuration:.1 animations:^{
self.errorLabel.alpha = 1.0;
self.errorLabel.text = @"密码或用户名错误,请重试!";
} completion:^(BOOL finished) {
}];
}];
相关文章推荐
- 关于iOS UILabel 设置 UIEdgeInsets
- QuickSort快速排序-Java
- 如何解决问题“This Class is not Key Value Coding-Compliant for the Key”
- 获取唯一UUID/UDID的方案
- The Geometry has no Z values 解决办法
- Minigui3.0.12完美安装,折腾了一天。终于看到了
- Distinct Subsequences
- easyui 中重复加载两次url
- SiteMesh,Avalon,RequireJS
- 编辑框自动滚屏到最后
- HDU——5667Sequence(矩阵快速幂+费马小定理应用)
- Material Design UI Widgets ——FloatingActionButton
- Android 学习笔记 Contacts (一)ContentResolver query 参数详解
- MySQL----error:no query specified
- Swing基本组件使用3(JMenuBar,JMenu,JMenuItem)
- Vue.js-----轻量高效的MVVM框架(十二、组件动态切换)
- UIScrollView(滑动视图)
- 如何避免scope的query界面切换到preview界面
- C H A P T E R 2 9 Building a Web Services Client 29章构建一个Web Services 客户端
- Android UI性能优化(一)