成人午夜视频全免费观看高清-秋霞福利视频一区二区三区-国产精品久久久久电影小说-亚洲不卡区三一区三区一区

IOS中如何實(shí)現(xiàn)彈框

這篇文章主要介紹了IOS中如何實(shí)現(xiàn)彈框,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

目前累計(jì)服務(wù)客戶(hù)上1000+,積累了豐富的產(chǎn)品開(kāi)發(fā)及服務(wù)經(jīng)驗(yàn)。以網(wǎng)站設(shè)計(jì)水平和技術(shù)實(shí)力,樹(shù)立企業(yè)形象,為客戶(hù)提供網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)、網(wǎng)站策劃、網(wǎng)頁(yè)設(shè)計(jì)、網(wǎng)絡(luò)營(yíng)銷(xiāo)、VI設(shè)計(jì)、網(wǎng)站改版、漏洞修補(bǔ)等服務(wù)。創(chuàng)新互聯(lián)建站始終以務(wù)實(shí)、誠(chéng)信為根本,不斷創(chuàng)新和提高建站品質(zhì),通過(guò)對(duì)領(lǐng)先技術(shù)的掌握、對(duì)創(chuàng)意設(shè)計(jì)的研究、對(duì)客戶(hù)形象的視覺(jué)傳遞、對(duì)應(yīng)用系統(tǒng)的結(jié)合,為客戶(hù)提供更好的一站式互聯(lián)網(wǎng)解決方案,攜手廣大客戶(hù),共同發(fā)展進(jìn)步。

IOS 中彈框的實(shí)現(xiàn)方法整理

#define iOS8Later ([UIDevice currentDevice].systemVersion.doubleValue >= 8.0)

ios 8以前的彈框

@interface RootViewController ()<UIAlertViewDelegate> 
 
@end
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"登陸失敗" message:@"請(qǐng)重新輸入用戶(hù)名和密碼" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"確定", nil]; 
      [alert show];
#pragma mark - UIAlertView Delegate Methods - 
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex 
{ 
  if(buttonIndex == 0) 
  { 
    NSLog(@"點(diǎn)擊取消按鈕后,想要的操作,可以加此處"); 
  } 
  else if(buttonIndex == 1) 
  { 
    NSLog(@"點(diǎn)擊確定按鈕后,想要的操作,可以加此處"); 
  } 
}

ios8以后的彈框

  UIAlertController *_alertVC = [UIAlertController alertControllerWithTitle:@"登陸失敗" message:@"請(qǐng)重新輸入用戶(hù)名和密碼" preferredStyle:UIAlertControllerStyleAlert]; 
       
      //警告類(lèi)型,紅色字體 UIAlertActionStyleDestructive 
//      UIAlertAction *_doAction = [UIAlertAction actionWithTitle:@"確定" style:UIAlertActionStyleDestructive handler:nil]; 
//      [_alertVC addAction:_doAction]; 
       
      UIAlertAction *_doAction = [UIAlertAction actionWithTitle:@"確定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) 
      { 
        NSLog(@"點(diǎn)擊確定按鈕后,想要的操作,可以加此處"); 
      }]; 
      [_alertVC addAction:_doAction]; 
 
//      UIAlertAction *_cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]; 
//      [_alertVC addAction:_cancleAction]; 
       
      UIAlertAction *_cancleAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) 
      { 
        NSLog(@"點(diǎn)擊取消按鈕后,想要的操作"); 
      }]; 
      [_alertVC addAction:_cancleAction]; 
       
      [self presentViewController:_alertVC animated:YES completion:nil];
//警告類(lèi)型,紅色字體 UIAlertActionStyleDestructive,如下圖所示的效果

      UIAlertAction *_doAction = [UIAlertAction actionWithTitle:@"確定" style:UIAlertActionStyleDestructive handler:nil];

      [_alertVC addAction:_doAction];

IOS中如何實(shí)現(xiàn)彈框

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“IOS中如何實(shí)現(xiàn)彈框”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!

當(dāng)前名稱(chēng):IOS中如何實(shí)現(xiàn)彈框
鏈接URL:http://jinyejixie.com/article0/ghhdoo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供服務(wù)器托管、用戶(hù)體驗(yàn)定制開(kāi)發(fā)、面包屑導(dǎo)航、微信公眾號(hào)網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

綿陽(yáng)服務(wù)器托管
满城县| 武功县| 淄博市| 克山县| 白水县| 白银市| 英吉沙县| 兰考县| 华阴市| 安康市| 新津县| 太湖县| 漳州市| 高平市| 棋牌| 咸阳市| 章丘市| 长治市| 迭部县| 崇州市| 平遥县| 巴东县| 西贡区| 沾化县| 弥勒县| 上虞市| 册亨县| 万全县| 宁海县| 增城市| 富源县| 仲巴县| 凤山市| 民丰县| 台北县| 阿瓦提县| 枣强县| 长治县| 墨玉县| 米脂县| 凤山县|