日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

AlertView动画

發布時間:2024/8/26 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 AlertView动画 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

AlertView動畫

?

效果

?

源碼

https://github.com/YouXianMing/Animations

// // AbstractAlertView.h // Animations // // Created by YouXianMing on 16/1/2. // Copyright ? 2016年 YouXianMing. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @class AbstractAlertView;@protocol AbstractAlertViewDelegate <NSObject>/*** The AlertView's event.** @param alertView The AlertViewProtocol object.* @param event Event data.* @param index Event index.*/ - (void)alertView:(AbstractAlertView *)alertView data:(id)data atIndex:(NSInteger)index;@end@interface AbstractAlertView : UIView/*** The AlertView event delegate.*/ @property (nonatomic, weak) id <AbstractAlertViewDelegate> delegate;/*** The title, default is nil.*/ @property (nonatomic, strong) NSString *title;/*** The subtitle, default is nil.*/ @property (nonatomic, strong) NSString *subTitle;/*** The message, default is nil.*/ @property (nonatomic, strong) NSString *message;/*** Button's title array, default is nil.*/ @property (nonatomic, strong) NSArray <NSString *> *buttonsTitle;/*** The contentView.*/ @property (nonatomic, weak) UIView *contentView;/*** Auto hiden or not, default is NO.*/ @property (nonatomic) BOOL autoHiden;/*** If The autoHiden is YES, you should set the delay hiden duration, default is 2.0.*/ @property (nonatomic) NSTimeInterval delayAutoHidenDuration;/*** Show the AlertView.*/ - (void)show;/*** Hide the AlertView.*/ - (void)hide;/*** Store View with key.** @param view View.* @param key Key.*/ - (void)setView:(UIView *)view ForKey:(NSString *)key;/*** Get View with key.** @param key Key.** @return View.*/ - (UIView *)viewWithKey:(NSString *)key;@end // // AbstractAlertView.m // Animations // // Created by YouXianMing on 16/1/2. // Copyright ? 2016年 YouXianMing. All rights reserved. // #import "AbstractAlertView.h"@interface AbstractAlertView ()@property (nonatomic, strong) NSMapTable *mapTable;@end@implementation AbstractAlertView- (instancetype)init {if (self = [super init]) {self.delayAutoHidenDuration = 2.f;self.autoHiden = NO;self.mapTable = [NSMapTable strongToWeakObjectsMapTable];}return self; }- (void)show {[NSException raise:@"AlertViewProtocol"format:@"Cannot use show method from subclass."]; }- (void)hide {[NSException raise:@"AlertViewProtocol"format:@"Cannot use hide method from subclass."]; }- (void)setView:(UIView *)view ForKey:(NSString *)key {[self.mapTable setObject:view forKey:key]; }- (UIView *)viewWithKey:(NSString *)key {return [self.mapTable objectForKey:key]; }@end

?

細節

動畫效果是基于一個抽象的基類實現的。

?

轉載于:https://www.cnblogs.com/YouXianMing/p/5094308.html

總結

以上是生活随笔為你收集整理的AlertView动画的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。