創作內容

0 GP

swift入門筆記-Button

作者:音無│2017-08-19 23:08:53│巴幣:0│人氣:213
Button 一些小筆記.


@IBAction func showAlertControll_actionsheet(){
        //建立控制項
        let alterController = UIAlertController(title: "提示訊息", message: "Im AlertController.actionsheet", preferredStyle: UIAlertControllerStyle.actionSheet)
        //建立選項
        alterController.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
        //顯示於螢幕上
        self.present(alterController, animated: true, completion: nil)
        
    }
    
    @IBAction func showAlertControll_alert(){
        let alterController = UIAlertController(title: "警告訊息", message: "Im AlertController.alert", preferredStyle: UIAlertControllerStyle.alert)
        alterController.addAction(UIAlertAction(title: "Delete", style: UIAlertActionStyle.destructive, handler: nil))
        self.present(alterController, animated: true, completion: nil)
    }
    
    @IBAction func showAlertControll(){
        //UIAlertControllerStytle.init(rawValue) ,rawValue: 0 = actionsheet, rawValue: 1 = alert
        let alterController = UIAlertController(title: "提示訊息", message: "Im rawValue: 0", preferredStyle: (UIAlertControllerStyle.init(rawValue: 0))!)
        let callAction = UIAlertAction(title: "Title", style: UIAlertActionStyle.default, handler: nil)
        print("Title")
        alterController.addAction(callAction)
        self.present(alterController, animated: true, completion: nil)
    }

    @IBAction func showAlertControllWithNoSelectButton(){
        //沒有做選項會卡在螢幕上不能動
        let alertController = UIAlertController(title: "警告訊息", message: "我沒有按鈕選項", preferredStyle: UIAlertControllerStyle.alert)
        self.present(alertController, animated: true, completion: nil)
    }
引用網址:https://home.gamer.com.tw/TrackBack.php?sn=3690140
All rights reserved. 版權所有,保留一切權利

相關創作

同標籤作品搜尋:Button

留言共 0 篇留言

我要留言提醒:您尚未登入,請先登入再留言

喜歡★zeroXoto 可決定是否刪除您的留言,請勿發表違反站規文字。

後一篇:C++指標使用....

追蹤私訊切換新版閱覽

作品資料夾

flys8028大家
遊戲介紹的小部落格,有空可以逛逛歐 https://www.rocksugarcat.com/看更多我要大聲說6小時前


face基於日前微軟官方表示 Internet Explorer 不再支援新的網路標準,可能無法使用新的應用程式來呈現網站內容,在瀏覽器支援度及網站安全性的雙重考量下,為了讓巴友們有更好的使用體驗,巴哈姆特即將於 2019年9月2日 停止支援 Internet Explorer 瀏覽器的頁面呈現和功能。
屆時建議您使用下述瀏覽器來瀏覽巴哈姆特:
。Google Chrome(推薦)
。Mozilla Firefox
。Microsoft Edge(Windows10以上的作業系統版本才可使用)

face我們了解您不想看到廣告的心情⋯ 若您願意支持巴哈姆特永續經營,請將 gamer.com.tw 加入廣告阻擋工具的白名單中,謝謝 !【教學】