AlertDialog custom Style

Source: Internet
Author: User

 

For the pop-up dialog box of the selected item like the list, to change the style, the layout method is rewritten.

 

Today, I learned that you can customize styles. It's actually very easy to share with you.

 

 

AlertDialog. Builder builder = new AlertDialog. Builder (new ContextThemeWrapper (this, R. style. AlertDialogCustom ));

 

 

Then you can customize your own style.

 

<? Xml version = "1.0" encoding = "UTF-8"?>

<Resources>

<Style name = "AlertDialogCustom" parent = "@ android: style/AlertDialog">

<Item name = "android: textColor"> #00FF00 </item>

<Item name = "android: typeface"> monospace </item>

<Item name = "android: textSize"> 10sp </item>

</Style>

</Resources>

Excerpted from: boarding a building on your own to view tianyao Road

Related Article

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.