我的行動吧,目前是這樣的:如何更改ActionBarSherlock上的IcsSpinner的文本顏色?
我希望它是這樣的:
忽略標誌旁邊的黑線。主要是我想要的是change the color of the text in the IcsSpinner to white
我的活動代碼:
ArrayAdapter<String> listAdapter = new ArrayAdapter<String>(this,
R.layout.sherlock_spinner_item, cities);
listAdapter
.setDropDownViewResource(R.layout.sherlock_spinner_dropdown_item);
setContentView(mViewPager);
final ActionBar bar = getSupportActionBar();
bar.setCustomView(R.layout.custom_actionbar);
bar.setIcon(R.drawable.logo);
bar.setDisplayShowCustomEnabled(true);
IcsSpinner citySpinner = (IcsSpinner) (bar.getCustomView())
.findViewById(R.id.city_spinner);
citySpinner.setAdapter(listAdapter);
和我custom_actionbar.xml是:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:gravity="right|center_vertical"
android:orientation="horizontal" >
<com.actionbarsherlock.internal.widget.IcsSpinner
android:id="@+id/city_spinner"
android:layout_width="wrap_content"
android:layout_height="match_parent"/>
</RelativeLayout>
我連想微調是just left to the refresh icon
。就像第二張照片一樣。
謝謝
是的,在改變文字顏色解決。非常感謝。但我怎樣才能將IcsSpinner的位置更改爲右側??。就像在第二張圖片 –
你不能改變它的顯示位置。如果您需要更多的控制權,您必須使用自定義操作視圖。 –