当前位置: 代码迷 >> Android >> 求把空间展示到底部
  详细解决方案

求把空间展示到底部

热度:30   发布时间:2016-04-28 01:25:14.0
求把空间显示到底部
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >



        <TableRow
           android:background="#99ccff"
          android:layout_width="match_parent"
            android:layout_height="wrap_content" >

                        <TextView
                    android:layout_marginTop="4dp"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_weight="1"
                            android:defaultValue="true"
                             android:textColor="#000000"
                            android:text="VIP号:"
                             android:textSize="15sp"  />

             <EditText
                android:id="@+id/lsno"
                  android:layout_width="30dp"
               android:layout_marginTop="4dp"
                 android:textColor="#000000"
                 android:maxLength="8"
          android:textSize="18dp"
           android:layout_weight="4"
        android:background="@layout/edittext_bg"
  android:textCursorDrawable="@null"
        android:numeric="integer"
                />
            <TextView
                android:layout_width="wrap_content"
               android:layout_height="30dp"
               android:textSize="15sp" 
                android:layout_marginTop="4dp"
              android:layout_weight="1"
                 android:textColor="#000000"
                android:text="发货人:" />

                    <EditText
                android:id="@+id/mudi"
                  android:layout_width="30dp"
                   android:layout_marginTop="4dp"
               android:layout_weight="7"
                   android:textColor="#000000"
                 android:background="@layout/edittext_bg"
                android:textCursorDrawable="@null"
                android:textSize="18dp"
                android:gravity="center_horizontal"
                />
                    

        </TableRow>
         <TableRow
           android:background="#99ccff"
          android:layout_width="match_parent"
            android:layout_height="wrap_content" >
                     <Button
                android:id="@+id/button1"
                 android:layout_width="match_parent"
                  android:onClick="savevip"
                  android:textSize="15sp" 
                   android:layout_height="35dp"
             android:layout_weight="1"
                android:text="注册新VIP会员" />
        
</TableRow>
         
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/color_bg_background"
            android:orientation="vertical" >

            <!--
            android:divider="@color/devide_line" 
            android:background="@drawable/shape_line_more_gray"
            -->
<ListView
            android:id="@+id/aListView"     
            android:layout_width="match_parent"
             android:dividerHeight="1dp"
               android:background="@color/color_bg_background"
             android:divider="#000000" 
            android:layout_height="match_parent">
    
</ListView>
            <View
                android:layout_width="match_parent"
                android:layout_height="0.1dip"
                android:background="#8f9091" />
            
        </LinearLayout>
就是这里了
 <TableRow
           android:background="#99ccff"
          android:layout_width="match_parent"
            android:layout_height="wrap_content" >
                     <Button
                android:id="@+id/save"
                 android:layout_width="match_parent"
                  android:onClick="savevip"
                  android:textSize="15sp" 
                   android:layout_height="35dp"
             android:layout_weight="1"
                android:text="保存" />
        
</TableRow>
我想把这个按钮紧挨着底部显示出来
        
</LinearLayout>
------解决思路----------------------
引用:
Quote: 引用:

根布局用RelativeLayout,楼上这些相对属性就都可以用了。


还是不行

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#99ccff" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:layout_weight="1"
            android:defaultValue="true"
            android:text="VIP号:"
            android:textColor="#000000"
            android:textSize="15sp" />

        <EditText
            android:id="@+id/lsno"
            android:layout_width="30dp"
            android:layout_marginTop="4dp"
            android:layout_weight="4"
            android:maxLength="8"
            android:numeric="integer"
            android:textColor="#000000"
            android:textCursorDrawable="@null"
            android:textSize="18dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="30dp"
            android:layout_marginTop="4dp"
            android:layout_weight="1"
            android:text="发货人:"
            android:textColor="#000000"
            android:textSize="15sp" />

        <EditText
            android:id="@+id/mudi"
            android:layout_width="30dp"
            android:layout_marginTop="4dp"
            android:layout_weight="7"
            android:gravity="center_horizontal"
            android:textColor="#000000"
            android:textCursorDrawable="@null"
            android:textSize="18dp" />
    </TableRow>

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#99ccff" >

        <Button
            android:id="@+id/button1"
            android:layout_width="match_parent"
            android:layout_height="35dp"
            android:layout_weight="1"
            android:onClick="savevip"
            android:text="注册新VIP会员"
            android:textSize="15sp" />
    </TableRow>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >
        <ListView
            android:id="@+id/aListView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:divider="#000000"
            android:dividerHeight="1dp" >
        </ListView>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.1dip"
            android:background="#8f9091" />
    </LinearLayout>

    <TableRow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="#99ccff" >

        <Button
            android:id="@+id/save"
            android:layout_width="match_parent"
            android:layout_height="35dp"
            android:layout_weight="1"
            android:onClick="savevip"
            android:text="保存"
            android:textSize="15sp" />
    </TableRow>

</RelativeLayout>
  相关解决方案