0

我有一个活动,顶部有一个标题,下面有一个 EditText。当我发短信并在键盘上按 Enter 时,屏幕向下滚动并隐藏标题。有什么方法可以修复标题,或者当在键盘上按 enter 时,不向下滚动屏幕?

<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=".ComentariosActivity" >


<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="10"
    android:background="@drawable/background_40_blue"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="44dp"
        android:background="@drawable/navigation_bar"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/ivButtonOkComentarios"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:layout_marginBottom="1dp"
            android:layout_marginTop="2dp"
            android:src="@drawable/mini_button_ok" />

    </RelativeLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="10dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dp"
            android:text="4"
            android:textColor="#FFCC66"
            android:textSize="48sp" />

        <TextView
            android:id="@+id/tvRedeConfirmar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="2dp"
            android:text="Faça um comentário sobre a sua avaliação"
            android:textColor="@android:color/white"
            android:textSize="18sp" />

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="7"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:src="@drawable/borda_tabela" />

        <EditText
            android:id="@+id/etComentarios"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:ems="10"
            android:gravity="center_vertical|top"                
            android:maxLength="500"                 
            >               

            <requestFocus />
        </EditText>

    </LinearLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="3"
        android:gravity="bottom" >

    </RelativeLayout>

</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="2"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/ivRodapeComentarios"
        android:layout_width="match_parent"
        android:layout_height="56dp"
        android:background="#00000000"
        android:scaleType="fitXY"
        android:src="@drawable/rodape_tappa" />

</LinearLayout>

4

0 回答 0