网友通过本文主要向大家介绍了自定义对话框,android 自定义对话框,安卓自定义对话框,js自定义对话框,qt自定义对话框等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
showSetPwdDialog--自定义对话框,showsetpwddialog--
样式:
布局:
layout
dialog_set_pwd.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:orientation="vertical" > 6 7 <LinearLayout 8 android:layout_width="match_parent" 9 android:layout_height="wrap_content" 10 android:background="#EFEFEF" 11 android:orientation="horizontal" 12 android:padding="10dp" > 13 14 <ImageView 15 android:layout_width="wrap_content" 16 android:layout_height="wrap_content" 17 android:src="@drawable/dialog_title_default_icon" /> 18 19 <TextView 20 android:id="@+id/textView1" 21 android:layout_width="wrap_content" 22 android:layout_height="wrap_content" 23 android:layout_marginLeft="5dp" 24 android:text="设置密码" 25 android:textColor="@color/black" 26 android:textSize="18sp" /> 27 </LinearLayout> 28 29 <EditText 30 android:id="@+id/et_pwd" 31 android:layout_width="match_parent" 32 android:layout_height="wrap_content" 33 android:layout_margin="5dp" 34 android:hint="请输入密码" 35 android:inputType="textPassword" > 36 </EditText> 37 38 <EditText 39 android:id="@+id/et_pwd_confirm" 40 android:layout_width="match_parent" 41 android:layout_height="wrap_content" 42 android:layout_margin="5dp" 43 android:hint="请再次输入密码" 44 android:inputType="textPassword" /> 45 46 <LinearLayout 47 android:layout_width="match_parent" 48 android:layout_height="wrap_content" 49 android:orientation="horizontal" 50 android:padding="10dp" > 51 52 <Button 53 android:id="@+id/btn_ok" 54 android:layout_width="0dp" 55 android:layout_height="wrap_content" 56 android:layout_weight="1" 57 android:background="@drawable/btn_blue_selector" 58 android:text="确定" 59 android:layout_marginRight="5dp" 60 android:textColor="@color/white" /> 61 62 <Button 63 android:id="@+id/btn_cancel" 64 android:layout_width="0dp" 65 android:layout_height="wrap_content" 66 android:layout_weight="1" 67 android:background="@drawable/btn_white_selector" 68 android:text="取消" 69 android:textColor="@color/black" /> 70 </LinearLayout> 71 72 </LinearLayout>
状态选择器:
drawable
btn_blue_selector.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <selector xmlns:android="http://schemas.android.com/apk/res/android"> 3 4 <item android:drawable="@drawable/dg_btn_confirm_select" android:state_pressed="true"></item> 5 <item android:drawable="@drawable/dg_btn_confirm_normal"></item> 6 7 </selector>
btn_white_selector.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <selector xmlns:android="http://schemas.android.com/apk/res/android"> 3 4 <item android:drawable="@drawable/dg_button_cancel_select" android:state_pressed="true"></item> 5 <item android:drawable="@drawable/dg_button_cancel_normal"></item> 6 7 </selector>
引用值
values
colors.xml
1 <?xml version="1.0" encoding="utf-8"?> 2 <resources> 3 4 <color name="black">#000</color> 5 <color