gpt4 book ai didi

android - 元素 LinearLayout 没有必需的属性 layout_height

转载 作者:太空狗 更新时间:2023-10-29 12:39:18 24 4
gpt4 key购买 nike

每个 TextView 和 Button 以及 LinearLayout 标签都提示

'layout_height' attribute should be defined

'layout_width' attribute should be defined

这是我的 activity_main.xml:

<LinearLayout
xmlns:android="http://schemas.android.com/apk/rest/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/main_title" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/continue_label" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/new_game_label" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/about_label" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/exit_label" />
</LinearLayout>

我正在运行 Android Studio 1.1.0

最佳答案

将您的 xmlns 属性更改为:

xmlns:android="http://schemas.android.com/apk/res/android"

/res/ 不是 /rest/

关于android - 元素 LinearLayout 没有必需的属性 layout_height,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28651312/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com