Let's show you the picture first:
Look, is not very cool, hehe. Here I say the key point is to customize the size of the activity's form. This login box is not a Dialog, but an activity. How to define, that is, the theme of the activity is set to theme.dialog< Activity android:name= ". Alertdialogactivity "Android:theme=" @style/mytheme "/>mytheme.xml is my custom theme Mytheme.xml:<?xml version=" 1.0 " encoding= "Utf-8"?><resources><
style name= "MyTheme" parent= "Android:style/theme.dialog"> <item name= "Android:windowbackground" >
@drawable/login_box</item> <item name= "android:windowistranslucent" >true</item> <item name= "Android: Windowanimationstyle ">@+android:style/Animation.Translucent</item></style></resources> Login_box.xml is the shape of my custom form: <?xml version= "1.0" encoding= "Utf-8"? ><shape xmlns:android= "/http Schemas.android.com/apk/res/android "><solid android:color=" #00000000 "/><!--entity set to Transparent--><stroke Android:width= "1DP" color= "#FFFFFF"/><corners android:radius= "20DP"/><padding android:left= "1DP" android:top= "1DP" android:right= "1DP" android:bottom= "1DP"/></shape> in Dialog.xml, the key is to set the background picture < LinearLayout xmlns:android= "http://schemas.android.com/apk/res/android" android:orientation= "Vertical" Android: Layout_width= "Wrap_content" android:layout_height= "Wrap_content"
android:background= "@drawable/king3"> </LiinearLayout> Its use is to open up the entire form. OK, that's it. http://blog.sina.com.cn/s/blog_629b701e0100xwul.html