2015-07-11 25 views
0

我正在研究android應用程序的操作欄。我想actionLayout用給定樣式創建TextView

enter image description here

我讀的地方做最簡單的方法是讓TextView與特定風格的行動項目。 我知道如何將TextViewitemactionLayout屬性整合在menu xml文件中。

我正在尋找的唯一的事情就是具體的風格。我已經嘗試了很多android:style。無幫助

底部陰影出現在圖像沒有操作按鈕部分

+0

請使用自定義佈局,並在actionLayout –

+0

搜索自定義佈局如何創建谷歌的自定義佈局 – user2653926

+0

搜索,你會發現代碼它 –

回答

0

試試這個代碼在XML文件中:

<TextView android:id="@+id/textview" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:background="@drawable/yourimage" android:text="@string/home" android:textAppearance="?android:attr/textAppearanceSmall" />

做到這一點在你的代碼氮肥利用9 .pach繪製文件

+0

什麼是9 pach可繪製文件 – user2653926

+0

這是讓你的圖像澱粉能搜索谷歌如何使9pach文件 –