Android spinner default style does not support line breaks or font style modification Solutions
Source: Internet
Author: User
Android spinner's default style does not support line breaks and font style changes. Solution requirements: The system displays too much data and requires line breaks, while Android provides android. r. layout. simple_spinner_dropdown_item style does not support line breaks. Therefore, refer to the style modification provided by Android. The Code is as follows: custom Layout file: spinner_dropdown_item.xml is directly copied from Android. R. layout. simple_spinner_dropdown_item. You only need to modify Android: singleline and change it to false to support line feed. <? XML version = "1.0" encoding = "UTF-8"?> <Checkedtextview xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Id = "@ Android: ID/text1" style = "? Android: ATTR/spinnerdropdownitemstyle "Android: singleline =" false "Android: layout_width =" fill_parent "Android: layout_height = "? Android: ATTR/listpreferreditemheight "Android: ellipsize = "marquee"/>================================ ==========/// by default, the font style simple_spinner_item.xml cannot be modified. <? XML version = "1.0" encoding = "UTF-8"?> <Textview xmlns: Android = "http://schemas.android.com/apk/res/android" Android: gravity = "Left" Android: textcolor = "# 2a99fb" Android: textsize = "18sp" Android: textstyle = "bold" Android: singleline = "true" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" Android: ellipsize = "marquee"/>
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.