2015-07-11 51 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文件 –