Android-AlertView

原文地址:https://github.com/saiwu-bigkoo/Android-AlertView

圖片.png

仿iOS的AlertViewController 幾乎完美還原iOS 的 AlertViewController ,同時支持Alert和ActionSheet模式,每一個細節(jié)都是精雕細琢,并把api封裝成懶到極致模式,一行代碼就可以進行彈窗.

  compile 'com.bigkoo:alertview:1.0.3'
new AlertView("上傳頭像", null, "取消", null,
                new String[]{"拍照", "從相冊中選擇"},
                this, AlertView.Style.ActionSheet, new OnItemClickListener(){
                    public void onItemClick(Object o,int position){
                        Toast.makeText(this, "點擊了第" + position + "個", 
                        Toast.LENGTH_SHORT).show();
                    }
                }).show();
                
//或者builder模式創(chuàng)建
new AlertView.Builder().setContext(context)
                .setStyle(AlertView.Style.ActionSheet)
                .setTitle("選擇操作")
                .setMessage(null)
                .setCancelText("取消")
                .setDestructive("拍照", "從相冊中選擇")
                .setOthers(null)
                .setOnItemClickListener(listener)
                .build()
                .show();


new AlertView("標題", "內(nèi)容", null, new String[]{"確定"}, null, this, 
                AlertView.Style.Alert, null).show();
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容