当我在模拟器上使用ImageView尝试显示一张图片时,它能够正常显示。但是一旦我添加了一个按钮,图片就无法显示了。
我不知道这是否有帮助,但我的XML在工作时是这样的:
我不知道这是否有帮助,但我的XML在工作时是这样的:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView android:id="@+id/ImageView01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"/>
</LinearLayout>
无法工作:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<Button
android:id="@+id/backbutton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Back"/>
<ImageView android:id="@+id/ImageView01"
android:layout_height="wrap_content"
android:layout_width="fill_parent"/>
</LinearLayout>