简体   繁体   English

基于屏幕大小的Style.xml文件

[英]Style.xml file based on screen size

Android supports layouts for different screen sizes by suffixing layout folders with a certain screen size (large, sw600 etc). Android通过为具有特定屏幕尺寸(大,sw600等)的布局文件夹添加后缀来支持不同屏幕尺寸的布局。 Is this possible to do for styles as well? 样式也可以这样做吗? There is nothing in their documentation that I have found yet, but it seems logical to desire style.xml's that support specific screen sizes. 在他们的文档中我还没有找到任何东西,但是想要支持特定屏幕尺寸的style.xml似乎是合乎逻辑的。

yes its very simple just create values folder with the right suffix , you need EXAMPLE: 是的,它非常简单,只需创建带有正确后缀的values文件夹,您需要使用EXAMPLE:

values-sw600  values-hdpi

look here at bottom of the page http://developer.android.com/guide/practices/screens_support.html 请看页面底部的http://developer.android.com/guide/practices/screens_support.html

Yes you can do it. 是的,你可以做到。

Create a folder like for example values-sw600dp in the res directory and there you add your style.xml 在res目录中创建一个文件夹,例如values-sw600dp,然后在其中添加style.xml

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

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