private void ShowDialog () {
Final Dialog Dialog = new Dialog (mainactivity.this, R.style.my_style);
Dialog.setcontentview (R.LAYOUT.HELP);
Dialog.show ();
ImageView Imgview = (ImageView) Dialog.findviewbyid (R.ID.IMAGEVIEW_HELP);
Imgview.setonclicklistener (New Onclicklistener () {
@Override
public void OnClick (View arg0) {
Dialog.dismiss ();
}
});
}
Help.xml
<?xml version= "1.0" encoding= "Utf-8"?>
<linearlayout xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:layout_width= "Fill_parent"
android:layout_height= "Fill_parent"
android:orientation= "Vertical" >
<imageview
Android:id= "@+id/imageview_help"
Android:layout_width= "Fill_parent"
android:layout_height= "Fill_parent"
android:background= "@drawable/help"/>
</LinearLayout>
Strings.xml
<?xml version= "1.0" encoding= "Utf-8"?>
<resources>
<string name= "App_name" >TestView</string>
<string name= "Action_settings" >Settings</string>
<string name= "Hello_world" >hello world!</string>
<style name= "My_style" >
<item name= "Android:windowbackground" > @color/back_color</item>
<item name= "Android:windownotitle" >true</item>
<item name= "Android:windowistranslucent" >true</item>
<item name= "Android:windowanimationstyle" >@+android:style/Animation.Translucent</item>
</style>
</resources>
Color.xml
<?xml version= "1.0" encoding= "Utf-8"?>
<resources>
<drawable name= "Darkgray" > #808080 </drawable>
<color name= "Back_color" > #FF00FF </color>
<color name= "Top" > #33CCFF </color>
<color name= "Top_background" > #33CCFF </color>
</resources>
This article is from the "climb over the mountains to see the Sea" blog, please be sure to keep this source http://670176656.blog.51cto.com/4500575/1566766
The Android style uses demo