我要支持“升”和“RTL”我的应用程序。 我已经测试我的应用程序的LTR和它的作品,但是当我测试的手机阿拉伯语对我的布局languague图像和文本分散修复布局变化的设备语言为阿拉伯语
问题
的图像和文本框在RTL被反转。 我想要的文本和图像的位置是一样的,在“LTR”
My layout.xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/tools"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/Grey_50"
app:cardCornerRadius="0dp"
app:cardUseCompatPadding="true"
card_view:cardCornerRadius="dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image_news"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="end"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="fitXY" />
<TextView
android:id="@+id/txt_news_title"
android:layout_width="match_parent"
android:layout_gravity="start"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/image_news"
android:layout_marginRight="3dp"
android:textSize="13sp" />
<View
android:id="@+id/view1"
android:layout_below="@+id/image_news"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/recent"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_gravity="center"
android:layout_marginRight="2dp"
android:background="@drawable/ic_recent"
android:textAlignment="center" />
<TextView
android:id="@+id/txt_timedate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/recent"
android:layout_toRightOf="@+id/recent"
android:text="20:49"
android:textColor="@color/Grey_600"
android:textSize="16sp" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
组布局方向。 – Nas
@Nas哇它的作品!但他们说布局方向仅用于API 17及更高版本(当前最小值为16) 此警告消息是否会引起恐慌? –