Android supportsRtl属性
2017-09-05 本文已影响2335人
三十二蝉
前言
Android Studio新疆工程的时候会自带android:supportsRtl这个属性。借机科普一下。
官网文档
原文:
android:supportsRtl
Declares whether your application is willing to support right-to-left (RTL) layouts.
If set to true and targetSdkVersion is set to 17 or higher, various RTL APIs will be activated and used by the system so your app can display RTL layouts. If set to false or if targetSdkVersion is set to 16 or lower, the RTL
APIs will be ignored or will have no effect and your app will behave the same regardless of the layout direction ass ociated to the user's Locale choice (your layouts will always be left-to-right).
The default value of this attribute is false.
This attribute was added in API level 17.
这个属性是声明你的application是否愿意支持从右到左(原来RTL就是right-to-left 的缩写...)的布局。
如果设置为true,targetSdkVersion设置为17或更高的版本,各种RTL的API将被激活,系统使用您的应用程序可以显示RTL布局。如果设置为false,亦或者targetSdkVersion为16或者更低,RTL的API将被忽略或不影响应用程序(你的布局会从左至右)。此属性的默认值是false。此属性被添加到API 17。