Android 自定義彈出框?qū)崿F(xiàn)代碼
廢話不多說(shuō)了,直接給大家上關(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)代碼,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
- Android實(shí)現(xiàn)可輸入數(shù)據(jù)的彈出框
- Android使用Dialog風(fēng)格彈出框的Activity
- Android 多種簡(jiǎn)單的彈出框樣式設(shè)置代碼
- Android中自定義PopupWindow實(shí)現(xiàn)彈出框并帶有動(dòng)畫(huà)效果
- 高仿IOS的Android彈出框
- Android 仿微信朋友圈點(diǎn)贊和評(píng)論彈出框功能
- Android編程實(shí)現(xiàn)仿QQ發(fā)表說(shuō)說(shuō),上傳照片及彈出框效果【附demo源碼下載】
- android控件封裝 自己封裝的dialog控件
- android中ProgressDialog與ProgressBar的使用詳解
- Android自定義彈出框dialog效果
相關(guān)文章
Android應(yīng)用中使用ViewPager實(shí)現(xiàn)類似QQ的界面切換效果
這篇文章主要介紹了Android應(yīng)用中使用ViewPager實(shí)現(xiàn)類似QQ的界面切換效果的示例,文中的例子重寫(xiě)了PagerAdapter,并且講解了如何解決Android下ViewPager和PagerAdapter中調(diào)用notifyDataSetChanged失效的問(wèn)題,需要的朋友可以參考下2016-03-03
android 之Spinner下拉菜單實(shí)現(xiàn)級(jí)聯(lián)
android 之Spinner下拉菜單實(shí)現(xiàn)級(jí)聯(lián),需要的朋友可以參考一下2013-02-02
實(shí)例解析Android中使用Pull解析器解析XML的方法
這篇文章主要介紹了Android中使用Pull解析器解析XML的方法,與DOM和SAX解析方式相比人們更推崇Pull,需要的朋友可以參考下2016-04-04
Android Intent傳遞數(shù)據(jù)底層分析詳細(xì)介紹
這篇文章主要介紹了Android Intent傳遞數(shù)據(jù)底層分析詳細(xì)介紹的相關(guān)資料,需要的朋友可以參考下2017-02-02
Android編程之自定義AlertDialog(退出提示框)用法實(shí)例
這篇文章主要介紹了Android編程之自定義AlertDialog(退出提示框)用法,結(jié)合實(shí)例形式較為詳細(xì)的分析了自定義AlertDialog的頁(yè)面布局與功能實(shí)現(xiàn)相關(guān)技巧,需要的朋友可以參考下2016-01-01
Android入門(mén)之SubMenu的實(shí)現(xiàn)詳解
這篇文章主要為大家詳細(xì)介紹了Android如何實(shí)現(xiàn)SubMenu子菜單的效果,文中的示例代碼講解詳細(xì),對(duì)我們學(xué)習(xí)Android有一定的幫助,感興趣的可以了解一下2022-11-11
Adnroid 自定義ProgressDialog加載中(加載圈)
這篇文章主要介紹了Adnroid 自定義ProgressDialog加載中(加載圈),需要的朋友可以參考下2017-06-06
Android實(shí)現(xiàn)pdf在線預(yù)覽或本地預(yù)覽的方法
下面小編就為大家分享一篇Android實(shí)現(xiàn)pdf在線預(yù)覽或本地預(yù)覽的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2018-01-01

