Hướng dẫn trong ConstraintLayout
có hỗ trợ RTL không? Tôi đang tạo một View
có hình ảnh tiểu sử và thông tin người dùng ở bên phải. Tôi muốn hình ảnh chiếm 30% chiều rộng trong khi tên người dùng và chi tiết chiếm 70%. Đây có phải là trường hợp sử dụng hợp lệ cho Nguyên tắc không? Tôi biết các triển khai khác nhưng tôi đã tự hỏi liệu các nguyên tắc có thể được sử dụng ở đây hay không. Vấn đề tôi đang phải đối mặt là phương châm vẫn còn trong vị trí của nó ở bên trái sau khi thay đổi thiết bị ngôn ngữ sang ngôn ngữ RTLHướng dẫn trong hỗ trợ ConstraintLayout RTL
Đây là xml:
<?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">
<ImageView
android:id="@+id/imageView"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:background="@color/colorPrimary"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="24sp"
tools:text="Full Name"
app:layout_constraintTop_toTopOf="@+id/imageView"
app:layout_constraintStart_toEndOf="@+id/guideline2" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
tools:text="Android Developer"
app:layout_constraintBottom_toBottomOf="@+id/imageView"
app:layout_constraintStart_toEndOf="@+id/guideline2" />
<android.support.constraint.Guideline
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/guideline2"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.30" />
</android.support.constraint.ConstraintLayout>
Cảm ơn, tôi vừa kiểm tra trình theo dõi vấn đề và thấy nó đã được báo cáo: https://issuetracker.google.com/issues/38101983 – Ibrahim
Cảm ơn, tôi cũng sẽ theo dõi nó. – auval
Vấn đề được giải quyết chính thức trong ConstraintLayout 1.1.0 beta 3 https://androidstudio.googleblog.com/2017/10/constraintlayout-110-beta-3-is-now.html – Ibrahim