通过string.xml将项目添加到listview不会';t在android中更新设计,但在emulator中工作
我是android新手。我尝试制作一个简单的活动来显示项目列表,但在我使用android:entries=“@array/options”将静态项目添加到布局后,我的设计没有更新,但当我运行我的应用程序时,我可以看到项目,而不是布局设计中的默认项目 这是我的xml代码:通过string.xml将项目添加到listview不会';t在android中更新设计,但在emulator中工作,android,android-listview,android-linearlayout,Android,Android Listview,Android Linearlayout,我是android新手。我尝试制作一个简单的活动来显示项目列表,但在我使用android:entries=“@array/options”将静态项目添加到布局后,我的设计没有更新,但当我运行我的应用程序时,我可以看到项目,而不是布局设计中的默认项目 这是我的xml代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="
<?xml version="1.0" encoding="utf-8"?>
<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="vertical"
tools:context=".MainActivity">
<ImageView
android:layout_width="200dp"
android:layout_height="100dp"
android:src="@drawable/starbuzz_logo"
android:contentDescription="@string/starbuzz_logo" />
<ListView
android:id="@+id/list_options"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:entries="@array/options" />
</LinearLayout>
这是我的emulator和design屏幕截图:
但当使用约束布局时,我并没有遇到这个问题。我想知道为什么。另外,这个问题是特定于listview的还是约束布局提供了一些优势