每当我在android studio中创建新项目时,我都会进入android:supportsRtl="true"
我的应用AndroidManifest文件.
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
...
</application>
Run Code Online (Sandbox Code Playgroud)
什么在app中使用,或者在我的应用AndroidManifest中添加或不添加时有什么优缺点.
android android-manifest android-applicationinfo android-studio
请查看以下图片:
第一张图片是我做的布局,它在我的设备和其他测试设备上正常显示.第二张图片是我朋友设备上显示的布局,它是相反的.我不知道为什么,它只发生在少数设备上.
这是我在xml上的布局代码.
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:auto="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.ComposeSmsActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar_action" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/padding_5">
<com.hnib.smslater.views.FlowLayout
android:id="@+id/layout_name_recipient"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_10"
android:fontFamily="sans-serif-light"
android:orientation="horizontal">
</com.hnib.smslater.views.FlowLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/padding_10">
<com.hnib.smslater.views.ClearableAutoContactCompleteTextView
android:id="@+id/et_recipient"
android:layout_width="@dimen/width_et_contact"
android:layout_height="@dimen/height_et_default"
android:layout_centerVertical="true"
android:layout_marginTop="@dimen/margin_10"
android:background="@drawable/drawable_radius_gray_gray"
android:fontFamily="sans-serif-light"
android:hint="@string/to_"
android:imeOptions="actionDone"
android:padding="@dimen/padding_5"
android:textColorHint="@color/gray"
android:textSize="18sp"
android:textStyle="bold"
auto:displayPhotoIfAvailable="false"
auto:styleOfTypedLetters="bold"
auto:typeOfData="phone"
auto:typedLettersHaveDifferentStyle="true" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_5"
android:layout_marginTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:fontFamily="sans-serif-light"
android:text="@string/message"
android:textColor="@color/gray"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_message_length"
android:layout_width="wrap_content" …
Run Code Online (Sandbox Code Playgroud)