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 surfaceView實(shí)現(xiàn)播放視頻功能
這篇文章主要為大家詳細(xì)介紹了android surfaceView實(shí)現(xiàn)播放視頻功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-05-05
Android編程之View簡(jiǎn)單學(xué)習(xí)示例
這篇文章主要介紹了Android編程之View簡(jiǎn)單學(xué)習(xí)示例,以一個(gè)實(shí)例形式較為詳細(xì)的分析了View的功能、定義及使用技巧,需要的朋友可以參考下2015-10-10
Android編程實(shí)現(xiàn)3D旋轉(zhuǎn)效果實(shí)例
這篇文章主要介紹了Android編程實(shí)現(xiàn)3D旋轉(zhuǎn)效果的方法,基于Android的Camera類實(shí)現(xiàn)坐標(biāo)變換達(dá)到圖片3D旋轉(zhuǎn)效果,需要的朋友可以參考下2016-01-01
Flutter質(zhì)感設(shè)計(jì)之彈出菜單
這篇文章主要為大家詳細(xì)介紹了Flutter質(zhì)感設(shè)計(jì)之彈出菜單,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-08-08
Android Fragment 和 FragmentManager 的代碼分析
這篇文章主要介紹了Android Fragment 和 FragmentManager 的代碼分析,非常不錯(cuò),具有參考借鑒價(jià)值,需要的的朋友參考下吧2017-01-01
Android 啟動(dòng)第三方程序的方法總結(jié)
這篇文章主要介紹了Android 啟動(dòng)第三方程序的方法總結(jié)的相關(guān)資料,需要的朋友可以參考下2017-04-04
Android編程設(shè)計(jì)模式之狀態(tài)模式詳解
這篇文章主要介紹了Android編程設(shè)計(jì)模式之狀態(tài)模式,結(jié)合實(shí)例形式詳細(xì)分析了Android狀態(tài)模式的概念、功能、使用方法及相關(guān)注意事項(xiàng),需要的朋友可以參考下2017-12-12

