网站建设技术实现,wordpress 文章页面怎样全屏显示,直播软件app平台大全,网上如何建网站系统默认的对话框只能显示简单的标题内容以及按钮#xff0c;而如果想要多现实其他内容则就需要自定义对话框#xff0c;下面是自定义对话框的方法。 1、先定义对话框的模版 ?xml version1.0 encodingutf-8?
LinearLayout xmlns:andro… 系统默认的对话框只能显示简单的标题内容以及按钮而如果想要多现实其他内容则就需要自定义对话框下面是自定义对话框的方法。 1、先定义对话框的模版 ?xml version1.0 encodingutf-8?
LinearLayout xmlns:androidhttp://schemas.android.com/apk/res/androidandroid:layout_width300dpandroid:layout_heightmatch_parentandroid:orientationvertical TextView android:idid/tv_titleandroid:layout_width300dpandroid:layout_height30dpandroid:textSize22spandroid:text设置中心android:gravitycenter/
EditTextandroid:idid/ed_passwordandroid:layout_width300dpandroid:layout_height50dpandroid:textSize22spandroid:hint输入密码/
EditText android:idid/ed_re_passwordandroid:layout_width300dpandroid:layout_height50dpandroid:textSize22spandroid:hint重新输入密码/
LinearLayout android:layout_heightwrap_contentandroid:layout_width300dpandroid:orientationhorizontalandroid:gravitycenter_horizontalButton android:idid/btn_okandroid:text确定android:layout_widthwrap_contentandroid:layout_heightwrap_content/Button android:idid/btn_cancelandroid:text取消android:layout_widthwrap_contentandroid:layout_heightwrap_content/
/LinearLayout
/LinearLayout 2、之后将使用对话框模版将对话框重新渲染。 AlertDialog.Builder dialog new Builder(this);View view View.inflate(MainActivity.this, R.layout.set_password_dialog, null);dialog.setView(view);dialog.show(); 3、通过以上设置就可自定义对话框