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>
         
  • 相关阅读:
    pygame 笔记-7 生命值/血条处理
    pygame 笔记-6 碰撞检测
    pygame 笔记-5 模块化&加入敌人
    pygame 笔记-4 代码封装&发射子弹
    tk.mybatis通用插件updateByPrimaryKeySelective无法自动更新ON UPDATE CURRENT_TIMESTAMP列的解决办法
    pygame 笔记-3 角色动画及背景的使用
    pygame 笔记-2 模仿超级玛丽的弹跳
    pygame 笔记-1 按键控制方块移动
    mysql技巧:如果记录存在则更新/如果不存在则插入的三种处理方法
    mac上mysql8.0以tar.gz方式手动安装
  • 原文地址:https://www.cnblogs.com/helloweworld/p/2677509.html
Copyright © 2011-2022 走看看