zoukankan      html  css  js  c++  java
  • android 控件放在 listview 的下方 并且在 屏幕底部

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" 
        android:background="@drawable/bg2">
    <!--
       layout_weight在此处的含义是所占剩余空间的比例,没指定layout_weight默认为0.
       在height上,首先给ListView分配0dip大小,给RelativeLayout分配wrap_content大小。
       然后把height剩余空间按照比例1:0分配各ListView和RelativeLayout.
    -->
        <ListView 
             android:id="@+id/displayLV" 
             android:layout_width="fill_parent"
             android:layout_height="0dip" 
             android:drawSelectorOnTop="false"
             android:scrollbars="vertical" 
             android:layout_weight="1"/>
        <RelativeLayout 
             android:id="@+id/bottom"
             android:layout_width="fill_parent"
             android:background="@drawable/view_yuan_morelist"
             android:layout_height="wrap_content"> 
            <ImageButton
                 android:id="@+id/searchBtn"
                 android:src="@drawable/scan"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:padding="0dp"
                 android:layout_centerHorizontal="true"
                 />
            <TextView 
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
                 android:layout_below="@+id/searchBtn"
                 android:layout_centerHorizontal="true"
                 android:text="扫描图书条码"/>           
        </RelativeLayout>
       
    </LinearLayout>
         
  • 相关阅读:
    大道至简——一个例子讲清楚观察者模式
    博客园界面代码风格自定义设置
    前端资源网址大集合
    如何检测浏览器是否安装了Adblock,uBlock Origin,Adguard,uBlock等广告屏蔽插件
    WebUploader 上传插件结合bootstrap的模态框使用时选择上传文件按钮无效问题的解决方法
    js中+号的另外一种用法
    C++ 最简单的日志类
    树莓派入门(3)—— 基本配置
    树莓派入门(2)——安装系统
    树莓派入门(1)——准备工作
  • 原文地址:https://www.cnblogs.com/helloweworld/p/2677509.html
Copyright © 2011-2022 走看看