小编man*_*pha的帖子

android:是约束布局支持RTL

什么是在Android Studio的约束布局中支持RTL的最佳实践,
或者我应该创建一个分隔布局,一个用于英语,另一个用于阿拉伯语?

英文版

英文版

预期的布局与阿拉伯语 预期的布局与阿拉伯语

将设备语言从英语更改为阿拉伯语时的输出布局 将语言从英语更改为阿拉伯语时的输出布局

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:text="@string/CourseName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/textView7"
        android:layout_marginTop="16dp"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginStart="16dp"
        app:layout_constraintLeft_toLeftOf="parent"
        android:layout_marginLeft="16dp"
        android:textAppearance="@style/TextAppearance.AppCompat.Display1" />

    <Button
        android:text="@string/enroll"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/button"
        android:layout_marginTop="16dp"
        app:layout_constraintTop_toTopOf="parent"
        android:layout_marginEnd="16dp"
        app:layout_constraintRight_toRightOf="parent"
        android:layout_marginRight="16dp"
        android:textAppearance="@style/TextAppearance.AppCompat.Display2" />
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

android right-to-left

13
推荐指数
2
解决办法
4746
查看次数

标签 统计

android ×1

right-to-left ×1