scrollview tablelayout 使用问题

新手螃蟹 发布于 2014/09/15 20:07
阅读 660
收藏 0
本人新手,在使用scrollview和tablelayout的时候出现了一个问题,望各位帮忙解惑。

先贴代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".InfoEntryActivity" >
    <LinearLayout
        android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:minHeight="93dp"
     android:orientation="horizontal"
     android:layout_weight="5"
     android:background="@drawable/collect_title">
        <ImageView
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:id="@+id/backbutton"
            android:layout_gravity="center_vertical"
            android:background="@drawable/backbutton">
        </ImageView>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:minHeight="78dp"
     android:orientation="horizontal"
     android:layout_weight="5"
     android:background="@drawable/collect_step3">
    </LinearLayout>
    <ScrollView android:id="@+id/ScrollView01"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fillViewport="true"
    android:layout_weight="1"  >
        <TableLayout 
            android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/background_oem"
     android:gravity="center_horizontal"
     android:stretchColumns="*"  
         android:padding="3dip" >
            <TableRow android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal"
                android:gravity="center_horizontal"
                android:layout_gravity="center_horizontal">
                    <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textSize="@dimen/titletextsize"
            android:textColor="@color/black"
            android:text="信息表"
            android:gravity="center_horizontal"
            android:layout_column="1"  
                 android:layout_span="6"
                 android:layout_marginBottom="5dp" />
            </TableRow> 
            <TableRow android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal"
                android:gravity="center_horizontal"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="5dp">
                    <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textSize="@dimen/textsize"
            android:textColor="@color/black"
            android:text="姓名:"
            android:layout_marginRight="10dip"  />
                    <EditText android:id="@+id/text0"
    android:layout_width="100dip"
    android:layout_height="wrap_content"
    android:layout_marginRight="10dip" />
                    <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textSize="@dimen/textsize"
            android:textColor="@color/black"
            android:text="曾用名:"  />
                    <EditText android:id="@+id/text1"
    android:layout_width="100dip"
    android:layout_height="wrap_content" />
                    <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textSize="@dimen/textsize"
            android:textColor="@color/black"
            android:text="性别:"  />
                     <!-- 定义一个城市信息下拉菜单-->    
    <Spinner     
        android:id="@+id/Spinner_sex"     
        android:layout_width="150dp"     
        android:layout_height="wrap_content"
        android:padding="5dip"  >     
    </Spinner > 
            </TableRow>
            <TableRow android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal"
                android:gravity="center_horizontal"
                android:layout_gravity="center_horizontal">
                    <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textSize="@dimen/textsize"
            android:textColor="@color/black"
            android:text="民族:"
            android:layout_marginRight="10dip"  />
                    <EditText android:id="@+id/text2"
    android:layout_width="100dip"
    android:layout_height="wrap_content"
    android:layout_marginRight="10dip" />
                    <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textSize="@dimen/textsize"
            android:textColor="@color/black"
            android:text="出生日期:"  />
                    <EditText android:id="@+id/text3"
    android:layout_width="100dip"
    android:layout_height="wrap_content" />
                    <TextView android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:textSize="@dimen/textsize"
            android:textColor="@color/black"
            android:text="籍贯:" />
                    <EditText android:id="@+id/text4"
    android:layout_width="100dip"
    android:layout_height="wrap_content" />
            </TableRow>
            
     </TableLayout>       
    </ScrollView>    
</LinearLayout>

问题描述:tablelayout中的edittext一旦获得到焦点调用出输入法后,上面2个LinearLayout里的图片就会压扁。输入法关闭后又恢复整成。请教大家,如何解决!
急急急!
加载中
0
码农明明
码农明明

manifest 文件这个activity中配置

android:windowSoftInputMode="adjustResize"



试试

返回顶部
顶部