版權聲明:您好,轉載請留下原文地址http://blog.csdn.net/jaychan_95318/article/details/58602756,謝謝
??Spinner是android的一個下拉列表的控件,默認使用的條目布局文件是android的資源目錄下的simple_list_item1.xml文件
下面是spinner的簡單使用
跑起來的效果如下
看起來是很不錯,可以如果想要讓條目的字體加粗或者修改下字體顏色該怎么做? 很簡單,讓我們先看一下simple_list_item1.xml的內容
原來只是一個TextView而已,由于不能直接在這個文件上修改,我們copy這個文件的內容,然后新建一個布局文件spinner_custom.xml 然后修改一下,讓字體加粗還有字體顏色也加一下
<?xml version="1.0" encoding="utf-8"?><TextView xmlns:android="http://schemas.android.com/apk/res/android" style="?attr/spinnerDropDownItemStyle" android:singleLine="true" android:textColor="#787878" android:layout_width="match_parent" android:layout_height="?attr/dropdownList然后修改MainActivity跑起來看看
效果果然改變了!
新聞熱點
疑難解答