Android Alertdialog Custom Style implementation code _android

Source: Internet
Author: User

Android Alertdialog Custom Style

Like a list of options for the pop-up dialog box, to change the style is generally taken to rewrite the layout way

Today to understand that can actually customize the style, and share with you, in fact, very simple

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> 



Thank you for reading, I hope to help you, thank you for your support for this site!

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.