9
我試圖得到一個ICS微調喜歡在我的應用程序,玩好幾個小時,最後我用HoloEverywhere得到這個,它的工作,但我有一個小disign問題,是因爲我在XML設置的微調並不包裹它的內容,並且在默認情況下是這樣的:Android的微調尺寸非常大
真的,我GOOGLE了好幾個小時了,而我發現的是,如何調整微調項目而不是視圖本身,就意味着我要微調調整到所選擇的項目大小是這樣的:
這裏是我的XML:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="horizontal" >
<org.holoeverywhere.widget.Spinner
android:id="@+id/spnCities"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
/>
<TextView
android:id="@+id/tvCities"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:text="@string/city"
android:textAppearance="?android:attr/textAppearanceSmall" />
任何幫助將受到歡迎。
謝謝。
這也爲我工作! 創建自己的CustomSpinner,只是implemeting該方法(無覆蓋),並使用IR在你的應用程序中所選項目的寬度剛好有他的真實與:) 在以前的版本中飛旋在默認情況下做到這一點,至少2.3 – Rako