首页 > 其他 > 详细

布局文件采用“-dp”实现“少则紧随listView底部,多则固定底部”

时间:2014-09-26 09:46:39      阅读:406      评论:0      收藏:0      [点我收藏+]

主要实现的功能:

数据少的时候则布局显示的效果为:下面的button紧随listView下面;

数据多的时候:button则固定在整个界面的底部。

布局文件如下:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">
    <ListView android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:id="@+id/listView"
              android:layout_marginBottom="50dp"></ListView>
    <Button android:layout_width="match_parent"
            android:layout_height="48dp"
            android:layout_marginTop="-48dp"/>

</LinearLayout>

布局文件采用“-dp”实现“少则紧随listView底部,多则固定底部”

原文:http://www.cnblogs.com/ccddy/p/3994154.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!