The Android style uses demo

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.