iOS 继承自 UIWindow 的扩展类 用来提示操作成功或者失败
2015-12-24 21:24
411 查看
- (instancetype)init
{
self = [superinit];
if (self) {
self.frame =CGRectMake(0,
-40, [UIScreenmainScreen].bounds.size.width,40);
[selfmakeKeyAndVisible];
}
return
self;
}
- (void)show{
[UIViewanimateWithDuration:1animations:^{
self.transform =CGAffineTransformMakeTranslation(0,40);
} completion:^(BOOL finished) {
[UIViewanimateWithDuration:1delay:1options:UIViewAnimationOptionCurveLinearanimations:^{
self.transform =CGAffineTransformMakeTranslation(0,
-40);
} completion:^(BOOL finished) {
[selfresignKeyWindow];
}];
}];
}
{
self = [superinit];
if (self) {
self.frame =CGRectMake(0,
-40, [UIScreenmainScreen].bounds.size.width,40);
[selfmakeKeyAndVisible];
}
return
self;
}
- (void)show{
[UIViewanimateWithDuration:1animations:^{
self.transform =CGAffineTransformMakeTranslation(0,40);
} completion:^(BOOL finished) {
[UIViewanimateWithDuration:1delay:1options:UIViewAnimationOptionCurveLinearanimations:^{
self.transform =CGAffineTransformMakeTranslation(0,
-40);
} completion:^(BOOL finished) {
[selfresignKeyWindow];
}];
}];
}
相关文章推荐
- 《Being Logical:A Guide to Good Thinking》
- uva 10479——The Hendrie Sequence
- NSMutableURLRequest实现Post请求
- Arduino - 看门狗定时器(WDT:Watch Dog Timer)
- UILabel的自适应长度
- 【转】Android自动化测试(UiAutomator)简要介绍
- vimgrep 查找光标下单词并打开quickfix
- UGUI - 使用动画来改变透明度解决
- UINavigationBar属性设置
- Why do I keep getting mixed tabs and spaces in a Visual Studio C# code window?[vs power tools issue transfered]
- 编译ceed(cegui editor)
- OpenCV【1】---OpenCV2.4.11 Build for QT 5.5.0 of Win7
- Android Studio 报错"gradle xxx is required. current version is xxx"
- 深入理解Message, MessageQueue, Handler和Looper
- 搭建自家的wiki平台:win2008 破解安装confluence-5.1.4 和 汉化。
- iOS笔记UI--生成二维码Demo(不是扫码,是根据字符串生成二维码)
- UE4中多种颜色轮廓线的后期处理
- Handler Looper MessageQueue 的关系
- UIVie和CALayer属性对应关系
- iOS UIBezierPath类 介绍