本文实例讲述了AndroID自定义个性化的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>
更多关于AndroID相关内容感兴趣的读者可查看本站专题:《Android开发入门与进阶教程》、《Android调试技巧与常见问题解决方法汇总》、《Android多媒体 *** 作技巧汇总(音频,视频,录音等)》、《Android基本组件用法总结》、《Android视图View技巧总结》、《Android布局layout技巧总结》及《Android控件用法总结》
希望本文所述对大家AndroID程序设计有所帮助。
总结以上是内存溢出为你收集整理的Android自定义个性化的Dialog示例全部内容,希望文章能够帮你解决Android自定义个性化的Dialog示例所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)