2015-10-11 33 views
0

我有一個微調後,我加載數據到它。風格並不像我預期的那樣。Android更改微調主題/底部邊框樣式

微調代碼

<Spinner 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/spinnerGender" 
       android:spinnerMode="dropdown" 
       android:layout_marginLeft="-5dp" 
       android:layout_marginTop="5dp"/> 

當前樣式。 enter image description here

我預計 enter image description here

如何更改主題/風格的微調

回答

10

試試這個,

<Spinner 
     android:id="@+id/spinnerGender" 
     style="@android:style/Widget.Holo.Light.Spinner" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="-5dp" 
     android:layout_marginTop="5dp" 
     android:spinnerMode="dropdown" /> 

否則,你可以創建custome的風格和使用 例在以下鏈接: http://androidopentutorials.com/android-how-to-get-holo-spinner-theme-in-android-2-x/

+0

它運作良好,感謝@Piyush – huynhthinh

+0

@huynhthinh你應該接受的答案,如果你的作品。 – rmoore

0

另一種方法是使用styles.xml文件

<!-- Application theme. --> 
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
    <item name="android:spinnerStyle">@android:style/Widget.Holo.Light.Spinner</item> 
</style>