求把空间显示到底部

Android 码拜 9年前 (2015-05-10) 869次浏览 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>

给TabRow加一个android:paddingBottom=”true”,这个是相对于父布局
无效啊,还是显示不出来
而且报错,说不能什么格式化
引用 3 楼 cmy_ymc 的回复:

而且报错,说不能什么格式化

写错……
 android:gravity=”bottom”

最后一个TlableRow 
<TableRow
           android:background=”#99ccff”
           android:layout_alignParentBottom = “true”添加这句试试呢
          android:layout_width=”match_parent”
            android:layout_height=”wrap_content” >

,还是不行啊
根布局用RelativeLayout,楼上这些相对属性就都可以用了。
引用 7 楼 li352558693 的回复:

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

还是不行

20分
引用 8 楼 cmy_ymc 的回复:
Quote: 引用 7 楼 li352558693 的回复:

根布局用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>


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明求把空间显示到底部
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!