Android 自定義彈出框?qū)崿F(xiàn)代碼
更新時間:2016年08月16日 11:14:57 作者:情深雨蒙
這篇文章主要介紹了Android 自定義彈出框?qū)崿F(xiàn)代碼的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
廢話不多說了,直接給大家上關(guān)鍵代碼了。
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self showAlertView:@"11111"]; } //自定義彈出框 -(void)showAlertView:(NSString *)strTipText { UIView *showView=[[UIView alloc]init]; [showView setFrame:CGRectMake(100, 100, 120, 35)]; [showView setAlpha:0.0f]; [showView setBackgroundColor:[UIColor blackColor]]; [showView setClipsToBounds:YES]; [[showView layer]setMasksToBounds:YES]; [[showView layer]setCornerRadius:5.0f]; UILabel *lblTips=[[UILabel alloc]init]; [lblTips setFrame:CGRectMake(0, 0, 120, 35)]; [lblTips setText:strTipText]; [lblTips setTextAlignment:NSTextAlignmentCenter]; [lblTips setTextColor:[UIColor whiteColor]]; [lblTips setBackgroundColor:[UIColor clearColor]]; [lblTips setFont:[UIFont boldSystemFontOfSize:16]]; [showView addSubview:lblTips]; [self.view addSubview:showView]; [UIView animateWithDuration:0.5f delay:0.0f options:UIViewAnimationOptionCurveLinear animations:^{ showView.alpha=1.0f; }completion:^(BOOL finished){ [UIView animateWithDuration:1.0f delay:1.0f options:UIViewAnimationOptionCurveLinear animations:^{ showView.alpha=0.0f; }completion:^(BOOL finished){ ; }]; }]; }
以上所述是小編給大家介紹的Android 自定義彈出框?qū)崿F(xiàn)代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
您可能感興趣的文章:
- Android實現(xiàn)可輸入數(shù)據(jù)的彈出框
- Android使用Dialog風(fēng)格彈出框的Activity
- Android 多種簡單的彈出框樣式設(shè)置代碼
- Android中自定義PopupWindow實現(xiàn)彈出框并帶有動畫效果
- 高仿IOS的Android彈出框
- Android 仿微信朋友圈點贊和評論彈出框功能
- Android編程實現(xiàn)仿QQ發(fā)表說說,上傳照片及彈出框效果【附demo源碼下載】
- android控件封裝 自己封裝的dialog控件
- android中ProgressDialog與ProgressBar的使用詳解
- Android自定義彈出框dialog效果
相關(guān)文章
Android使用Intent啟動其他非系統(tǒng)應(yīng)用程序的方法
這篇文章主要介紹了Android使用Intent啟動其他非系統(tǒng)應(yīng)用程序的方法,實例分析了Intent調(diào)用系統(tǒng)應(yīng)用程序的相關(guān)技巧,需要的朋友可以參考下2015-12-12Activity實例詳解之啟動activity并返回結(jié)果
這篇文章主要介紹了Activity實例詳解之啟動activity并返回結(jié)果 的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2016-09-09Android自定義引導(dǎo)玩轉(zhuǎn)ViewPager的方法詳解
這篇文章主要給大家介紹了關(guān)于Android自定義引導(dǎo)玩轉(zhuǎn)ViewPager的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對各位Android開發(fā)者們具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2019-06-06