android 界面布局 疑惑……

如图,
1为什么按钮在上面,我设置了bottom,什么原因,怎么解决?
2为什么手机上右边会有空出来,而且地下也有空出来?什么原因,怎么解决?图片说明图片说明

图片看不清楚,布局文件的代码我看下

把你的布局文件替换成如下:

<?xml version="1.0" encoding="utf-8"?>
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>

<Button
    android:id="@+id/button"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:paddingBottom="10dp"
    android:paddingTop="10dp"
    android:text="End this Activity"/>

<ListView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@id/button"></ListView>

这样就能达到你想要的效果了。

虽然楼主你的图片基本上看不清楚,但是如果你是想要bottom在底部,然后listView在bottom的上面的话,你就用RelativeLayout就行啦

把 button 和 Listview 换个位置, 之所以下面有空档 是因为你的数据太少,手机屏幕太大的原因

你的图片看不清楚,最上面的button,高度需要设置一个固定的值,宽度你需要写为match_parent,方便进行手机屏幕的适配,下面的listview,宽高都设置match_parent,listview根据数据的多少显示的高度也不一样,但是不能写成wrap_content,除非有特殊需求,注意的一点是,button不能写在listview下方,没有用,可以用footview实现
w

使用相对布局会更好实现 线性布局也可以设置方向 然后在将Bottom 放在ListView 下面