Android按钮布局-未正确显示
我正试图在我的Android应用程序的“欢迎屏幕”上显示三幅图像。只有一个图像正在显示,我不明白为什么。。。有什么帮助吗 XML文件:Android按钮布局-未正确显示,android,xml,layout,imagebutton,Android,Xml,Layout,Imagebutton,我正试图在我的Android应用程序的“欢迎屏幕”上显示三幅图像。只有一个图像正在显示,我不明白为什么。。。有什么帮助吗 XML文件: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_pa
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:background="@drawable/main_bg"
>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:paddingTop="30dip"
android:layout_height="wrap_content"
android:gravity="center"
>
<ImageButton
android:id="@+id/mnwvbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="15dip"
android:background="@drawable/mnwvicon" />
<ImageButton
android:id="@+id/reportsbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/reportsicon" />
</LinearLayout>
<ImageButton
android:id="@+id/mnwvshowbutton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/showicon"
android:paddingTop="30dip" />
</LinearLayout>
我在另一个应用程序中设置了完全相同的设置,所以我不知道它为什么不在这里工作???我认为这是因为最后一个图像在内部线性布局之外,所以将其放在内部线性布局之内,您应该能够连续看到所有三个图像。尝试使用属性android:ScaleType=“center”缩放图像在ImageButton内
或者尝试不同的布局,如Tablayout,以适当的间距将图像按行和列排列。对不起,伙计们。我没有应用程序支持不同的屏幕大小。我不知道为什么这很重要,但一旦我添加了支持,它就工作得非常好!。谢谢你的意见!有人知道为什么这很重要吗??我不知道为什么支持屏幕大小很重要?当我不使用图像时,布局对我来说很有效,因此如果没有图像或者不知道它们的实际尺寸,我就无法解决问题。假设您的第一个图像按钮mnwvbutton占据了屏幕上的所有空间,那么就没有其他按钮的位置。所以我想你需要修正图像的大小。对不起,伙计们。我没有应用程序支持不同的屏幕大小。我不知道为什么这很重要,但一旦我添加了支持,它就工作得非常好!。谢谢你的意见!有人知道为什么这很重要吗?事实上,有没有什么方法可以让我们知道你们在图形布局中得到的结果,这样我们就可以帮助你们了。