我遇到了一个问题,我的 ListView 显示在 Android Studio 的设计视图上,但没有显示在我的模拟器上。它运行成功,但我在模拟器上看不到任何东西。我试图删除 listView 以查看我的其他按钮是否会显示并且我可以看到它。我的代码有什么问题?先感谢您。我是初学者,请多多关照。这是我的代码:
'''
<?xml version="1.0" encoding="utf-8"?>
<GridLayout 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"
tools:context=".ChatRoomActivity">
<ListView
android:id="@+id/ListView"
android:layout_width="match_parent"
android:layout_height="682dp"
android:layout_row="0"
android:layout_column="0" />
<androidx.gridlayout.widget.GridLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_row="11"
android:layout_column="0">
<Button
android:id="@+id/Send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Send" />
<EditText
android:id="@+id/Message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine"
android:hint="@string/Message"
app:layout_column="1"
app:layout_row="0" />
<Button
android:id="@+id/Receive"
android:layout_width="108dp"
android:layout_height="wrap_content"
android:text="@string/Receive" />
</androidx.gridlayout.widget.GridLayout>
</GridLayout>