Android的FILL_PARENT问题 [英] Android fill_parent issue

查看:163
本文介绍了Android的FILL_PARENT问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好。这是我的布局

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <ListView android:id="@+id/lv"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@android:color/white" />
    <Button android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:layout_below="@id/lv" />
</RelativeLayout>

当我运行此列表视图占据整个屏幕。我想要的是全屏幕除了按钮区域不提DP列表视图。谢谢

When I run this the list view occupies full screen. What I want is list view to be full screen except button area without mentioning dp. Thanks

推荐答案

尝试一些可能性后,我发现这是有帮助的。

After trying out some possibilities I found this to be helpful

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <ListView android:id="@+id/lv"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@android:color/white" android:layout_above="@+id/bt"/>
    <Button android:layout_width="wrap_content" 
        android:layout_height="wrap_content"
        android:id="@+id/bt" android:layout_alignParentBottom="true"/>
</RelativeLayout>

谢谢回答大家。

这篇关于Android的FILL_PARENT问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆