阿拉伯语言可能不会在Android Studio 2.3 XML预览中显示

问题描述 投票:0回答:2

在我的xml文件中使用阿拉伯字符串时,它只显示在edittext提示属性中,但是属性文本工作正常,有什么想法可以解决这个问题吗?

enter image description here

我的XML看起来像这样

`

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">


    <android.support.design.widget.TextInputLayout
        android:id="@+id/userNameLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginEnd="20dp"
        android:layout_marginStart="20dp"
        android:layout_marginTop="20dp"
        android:gravity="center_vertical">
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/userNameET"
            android:inputType="text"
            android:background="@android:drawable/screen_background_light_transparent"
            android:hint="@string/first_name_text"
            android:drawablePadding="5dp"/>
    </android.support.design.widget.TextInputLayout>
</LinearLayout>

`

我的strings.xml看起来像

    <resources>

    <string name="user_name_text">أسم المستخدم</string>
    <string name="first_name_text">الاسم الأول</string>
</resources>
android xml localization android-studio-2.3
2个回答
0
投票

编辑:

被谷歌团队确认为bug


在试图找出问题所在之后,我得到了以下内容:

它看起来像是一个问题

android:hint="@string/string_name"

当它在TextInputLayout内部时,它不会渲染rtl文本!我不知道为什么[我认为这是Android工作室中的一个错误]

看看这个xml布局:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/main_screen_root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <EditText
        android:layout_width="match_parent"
        android:layout_weight="1"
        android:layout_height="0dp"
        android:inputType="text"
        android:padding="20dp"
        android:textAlignment="center"
        android:background="@android:drawable/screen_background_light_transparent"
        android:hint="@string/TextString"
        android:drawablePadding="5dp" />

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_weight="1"
        android:layout_height="0dp"
        android:padding="20dp">
        <EditText
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:inputType="text"
            android:textAlignment="center"
            android:background="@android:drawable/screen_background_light_transparent"
            android:hint="@string/TextString" />
    </android.support.design.widget.TextInputLayout>

    <TextView
        android:id="@+id/textView"
        android:layout_weight="1"
        android:layout_height="0dp"
        android:layout_width="match_parent"
        android:text="@string/TextString"
        android:textAlignment="center"
        android:padding="20dp" />
</LinearLayout>

如果你试图在Android studio qazxsw poi编辑器中查看它,它将无法正确呈现[见下图中的第1帧]

但是如果您编译并运行App n a device,它将正常呈现[见下图中的第2帧]!

xml


0
投票

参考enter image description here,这已得到修复。这是自Android studio 3.0.0 Canary 6构建以来可用的。

如果任何问题仍然存在,请在Google issue tracker报告,他们将重新开放审查。

© www.soinside.com 2019 - 2024. All rights reserved.