Android Studio:渲染问题

5
这是一些非常基础的内容。 在渲染过程中引发了一个异常: java.util.Locale.toLanguageTag()Ljava/lang/String;
XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">
    <EditText android:id="@+id/edit_message"
        android:layout_weight="1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:hint="@string/edit_message" />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/button_send" />
</LinearLayout>

看起来问题出在EditText对象上。感谢您的帮助。


也许需要检查你的 strings.xml 文件中的 edit_message 和/或 button_send 值。 - turtle
你提供多语言支持了吗? - Haresh Chhelana
@onm118 请检查您的 edit_message 字符串是否过长。请缩短它并重试。 - SimpleGuy
2个回答

17

对于有相同问题的人来说,这可能很有帮助。我使用的是IntelliJ IDEA,我也遇到了这个问题...

在玩弄设置一段时间后,我想起了我开始进行Android开发时遇到的这个问题。

造成这个问题的原因是,我正在为一部Android手机进行开发,但渲染设置却被设置为了Android Wear,将其更改为非穿戴式设置后,问题得到了解决。

进入图像描述


3

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接