https://github.com/ShrinkLynn/MBFadeAwayAlert
具體看demo吧题篷,其實(shí)就是一個(gè)view加上動(dòng)畫
使用非常簡單:
MBFadeAlertView *alert = [[MBFadeAlertView alloc]init];
/*
//這里可以改參數(shù)
alert.textFont = [UIFont systemFontOfSize:13.0f];
alert.fadeWidth = 200;
alert.fadeBGColor = [UIColor colorWithRed:94.0/255.0f green:105.0/255.0f blue:107.0/255.0f alpha:1.0f];
alert.titleColor = [UIColor whiteColor];
alert.textOffWidth = 18;
alert.textOffHeight = 8;
alert.textBottomHeight = 120;
alert.fadeTime = 1.5;
alert.FadeBGAlpha = 0.8;
*/
[alert showAlertWith:self.textView.text];
如果想方便的用词身,就寫個(gè)宏,放在常量頭文件里:
///彈出提示框
#define alert(__MSG) \
{\
MBFadeAlertView *alert = [[MBFadeAlertView alloc]init];\
[alert showAlertWith:@__MSG];\
}
簡書已經(jīng)棄用番枚,歡迎移步我的小專欄:
https://xiaozhuanlan.com/dahuihuiiOS