简体   繁体   English

使用styles.xml样式标签

[英]styling tabs using styles.xml

I have a row of 5 tabs at the bottom of my app. 我的应用程序底部有5个标签行。 The problem is the text is cut off on some of them. 问题是其中一些文字被截断。 I want to be able to have the text in each tab stack on top of each other instead of following along horizontally aswell as move the text into the center of the tab instead of sitting at the bottom. 我希望能够使每个选项卡堆栈中的文本彼此顶部,而不是沿水平方向跟随,以及将文本移至选项卡的中心而不是位于底部。

I have created a styles.xml file and have altered the text size but I am not sure how to add the requirments I stated above to it. 我已经创建了一个styles.xml文件,并且更改了文本大小,但是我不确定如何向其中添加上述要求。 Can anyone help? 有人可以帮忙吗?

Thanks 谢谢

The style resources uses the same XML attributes as an XML file. 样式资源使用与XML文件相同的XML属性。 You altered the text size successfully, so just add the attributes for the other desired styles. 您成功更改了文本大小,因此只需添加其他所需样式的属性即可。 If you don't know which attributes to use, just go to your XML file and type android: and your IDE should pop up a list of all Android XML attributes. 如果您不知道要使用哪些属性,只需转到XML文件并键入android:您的IDE应弹出所有Android XML属性的列表。 If not, go to the View page and read up on the "XML Attributes" section. 如果不是,请转到“ 视图”页面并在“ XML属性”部分进行阅读。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM