Android自定義個(gè)性化的Dialog示例
本文實(shí)例講述了Android自定義個(gè)性化的Dialog。分享給大家供大家參考,具體如下:
Dialog:
mDialog = new Dialog(this, R.style.chooseUserDialogTheme); mDialog.setTitle(R.string.choose_user); View rootView = LayoutInflater.from(this).inflate( R.layout.view_simple_choose_user, null); mDialog.setContentView(rootView); mLinearLayoutUserList = (LinearLayout) rootView .findViewById(R.id.linearLayout_user_list); mDialog.show(); mIsUserListShown = true; DialogInterface.OnDismissListener listener = new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialog) { timer.cancel(); mIsUserListShown = false; } }; mDialog.setOnDismissListener(listener);
R.style.chooseUserDialog
<style name="chooseUserDialogTheme" parent="@android:style/Theme.Dialog"> <item name="android:background">@android:color/transparent</item> <item name="android:textAppearance">@style/textAppearanceL</item> <item name="android:textColor">@android:color/white</item> <item name="android:windowBackground">@drawable/bg_choose_user_simple</item> <item name="android:popupBackground">@drawable/bg_main_activity_top_bar</item> </style>
R.layout.view_simple_choose_user
<?xml version="1.0" encoding="utf-8"?> <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/bg_main_activity_top_bar" android:orientation="vertical" > <LinearLayout android:id="@+id/linearLayout_user_list" android:layout_width="0dp" android:layout_height="wrap_content" android:orientation="horizontal" > </LinearLayout> </HorizontalScrollView>
更多關(guān)于Android相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Android開發(fā)入門與進(jìn)階教程》、《Android調(diào)試技巧與常見問題解決方法匯總》、《Android多媒體操作技巧匯總(音頻,視頻,錄音等)》、《Android基本組件用法總結(jié)》、《Android視圖View技巧總結(jié)》、《Android布局layout技巧總結(jié)》及《Android控件用法總結(jié)》
希望本文所述對(duì)大家Android程序設(shè)計(jì)有所幫助。
- Android中自定義對(duì)話框(Dialog)的實(shí)例代碼
- android dialog自定義實(shí)例詳解
- Android 去掉自定義dialog的白色邊框的簡(jiǎn)單方法
- Android自定義ProgressDialog進(jìn)度等待框
- 實(shí)例詳解Android自定義ProgressDialog進(jìn)度條對(duì)話框的實(shí)現(xiàn)
- Android使用自定義alertdialog實(shí)現(xiàn)確認(rèn)退出按鈕
- Android 自定義ProgressDialog進(jìn)度條對(duì)話框用法詳解
- 屬于自己的Android對(duì)話框(Dialog)自定義集合
- Android中制作自定義dialog對(duì)話框的實(shí)例分享
- Android編程之自定義AlertDialog(退出提示框)用法實(shí)例
- Android UI設(shè)計(jì)系列之自定義Dialog實(shí)現(xiàn)各種風(fēng)格的對(duì)話框效果(7)
- Android自定義ProgressDialog加載圖片
- Android自定義dialog簡(jiǎn)單實(shí)現(xiàn)方法
相關(guān)文章
淺談Android性能優(yōu)化之內(nèi)存優(yōu)化
Android的內(nèi)存優(yōu)化是性能優(yōu)化中很重要的一部分,本文將詳細(xì)介紹Android性能優(yōu)化之內(nèi)存優(yōu)化。2021-06-06Android app啟動(dòng)時(shí)黑屏或者白屏的原因及解決辦法
這篇文章主要介紹了Android app啟動(dòng)時(shí)黑屏或者白屏的原因及解決辦法的相關(guān)資料,需要的朋友可以參考下2016-09-09Android 實(shí)現(xiàn)可任意拖動(dòng)的懸浮窗功能(類似懸浮球)
這篇文章主要介紹了Android 可任意拖動(dòng)的懸浮窗(類似懸浮球),本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-05-05Android用文件存儲(chǔ)數(shù)據(jù)的方法
這篇文章主要為大家詳細(xì)介紹了Android用文件存儲(chǔ)數(shù)據(jù)的方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-10-10Android日期和時(shí)間選擇器實(shí)現(xiàn)代碼
這篇文章主要為大家詳細(xì)介紹了Android日期和時(shí)間選擇器實(shí)現(xiàn)代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-11-11Android 點(diǎn)擊editview以外位置實(shí)現(xiàn)隱藏輸入法
這篇文章主要介紹了Android 點(diǎn)擊editview以外位置實(shí)現(xiàn)隱藏輸入法的相關(guān)資料,需要的朋友可以參考下2017-06-06Android通過代碼控制ListView上下滾動(dòng)的方法
今天小編就為大家分享一篇關(guān)于Android通過代碼控制ListView上下滾動(dòng)的方法,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧2018-12-12Android基于AudioManager、PhoneStateListener實(shí)現(xiàn)設(shè)置黑名單功能
這篇文章主要介紹了Android基于AudioManager、PhoneStateListener實(shí)現(xiàn)設(shè)置黑名單功能的方法,涉及Android操作手機(jī)通信錄及通話模式與手機(jī)狀態(tài)的相關(guān)技巧,需要的朋友可以參考下2016-01-01