supportsRtl总是假的,这是我的:
<application
android:name="********"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:supportsRtl="true">
和
android {
compileSdkVersion 24
buildToolsVersion '23.0.3'
.
.
defaultConfig {
applicationId ".*****"
minSdkVersion 17
targetSdkVersion 24
versionName computeVersionName()
versionCode computeVersionCode()
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86"
}
}
和
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.android.support:design:24.1.1'
我从这里读取了值(我在所有布局上设置了android:layoutDirection =“rtl”但没有效果,所以我从这里看到了运行时的实际值)
StringBuilder sb = new StringBuilder();
Printer mPrinter = new StringBuilderPrinter(sb);
getContext().getApplicationInfo().dump(mPrinter, "ssaa");
String reportInfo = mPrinter.toString();
结果:
ssaa packageName=*****
ssaa labelRes=0x7f070167 nonLocalizedLabel=null icon=0x7f02011d banner=0x0
ssaa className=*****
ssaa processName=****
ssaa taskAffinity=*****
ssaa uid=10187 flags=0x2 theme=0x7f09009a
ssaa requiresSmallestWidthDp=0 compatibleWidthLimitDp=0 largestWidthLimitDp=0
ssaa sourceDir=/data/app/*****-1/base.apk
ssaa seinfo=default
ssaa agentType=1
ssaa allowedAgentType=1
ssaa category=1023
ssaa allowCategory=0,701-1023
ssaa bbccategory=1023
ssaa allowCategory=0,701-1023
ssaa accessInfo=0
ssaa dataDir=/data/data/********
ssaa enabled=true targetSdkVersion=24 versionCode=19111
ssaa supportsRtl=false
我试图通过自己设置标志但也没用(来自getApplicationInfo()。flags)
我有android studio 2.2预览版6
PS:我清理了项目但没有用,重新启动整个mac但没有用
PS:设备语言是阿拉伯语,希伯来语试过它们没有效果
PS:我添加了这个android:layoutDirection =“rtl”以确保它正常但没有效果