Android UI-ListView底部其他控件显示的小例子

  布局文件中放入ListView之后,在底部加其他控件正常情况会不显示,试出来个小例子,记录一下。

<?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"
        >

    <RelativeLayout
            android:id="@+id/ll_head"
            android:layout_weight="0.8"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            >

        <ImageView
                android:id="@+id/iv_me"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher"
                />

        <TextView
                android:id="@+id/tv_introduce"
                android:paddingTop="0dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="推荐"
                android:textSize="30dp"
                android:layout_centerHorizontal="true"
                />

        <ImageView
                android:id="@+id/iv_add"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_launcher"
                android:layout_alignParentRight="true"
                />
    </RelativeLayout>

    <ListView
            android:id="@+id/lv_content"
            android:layout_marginTop="10.0dip"
            android:layout_weight="10"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="20dp"
            >
    </ListView>

    <RelativeLayout
            android:id="@+id/ll_foot"
            android:layout_weight="0.8"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            >

        <Button
                android:id="@+id/btn_joke"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableTop="@drawable/ic_launcher"
                android:text="段子"
                />

        <Button
                android:id="@+id/btn_pic"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@id/btn_joke"
                android:drawableTop="@drawable/ic_launcher"
                android:text="图片"
                />

        <Button
                android:id="@+id/btn_video"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableTop="@drawable/ic_launcher"
                android:layout_centerHorizontal="true"
                android:text="视频"
                />

        <Button
                android:id="@+id/btn_search"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_toRightOf="@id/btn_video"
                android:drawableTop="@drawable/ic_launcher"
                android:text="发现"
                />

        <Button
                android:id="@+id/btn_check"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:drawableTop="@drawable/ic_launcher"
                android:text="审核"
                />
    </RelativeLayout>
</LinearLayout>
其他在底部加控件的参考网页:

http://www.cnblogs.com/loulijun/archive/2012/10/25/2738952.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值