3

我有一项活动,其中包含一个谷歌地图片段布局和下面的编辑文本。当我在编辑文本中输入一些文本时,软键盘将打开,edittext 将上升并与谷歌地图重叠。但是edittext没有出现,变黑了。当我从软键盘按回车时,它会显示出来。

这是布局:

   <?xml version="1.0" encoding="utf-8"?>
<!-- This can go anywhere in your layout (see other demos for some examples). -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <RelativeLayout
        android:id="@+id/mapLay"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="170dp" >

        <fragment
            android:id="@+id/map"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            class="com.google.android.gms.maps.SupportMapFragment" />
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/RelativeLayout5"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:background="@drawable/drop_up_bg"
        android:paddingBottom="10dp"
        android:paddingTop="20dp" >

        <RelativeLayout
            android:id="@+id/RelativeLayout2"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp" >

            <RelativeLayout
                android:id="@+id/RelativeLayout6"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true" >

                <TextView
                    android:id="@+id/textViewTitle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dp"
                    android:text="@string/map"
                    android:textColor="#000000"
                    android:textSize="16sp"
                    android:textStyle="bold" />

                <ImageView
                    android:id="@+id/imageViewLine"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignRight="@id/textViewTitle"
                    android:layout_below="@id/textViewTitle"
                    android:background="@drawable/black_line" />
            </RelativeLayout>

            <Button
                android:id="@+id/buttonAtras"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:background="@drawable/atra_btn" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/RelativeLayout3"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/RelativeLayout2"
            android:layout_centerHorizontal="true"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:layout_marginTop="5dp" >

            <EditText
                android:id="@+id/editTextMsg"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/text_stripe"
                android:gravity="top"
                android:paddingBottom="20dp"
                android:paddingLeft="10dp"
                android:paddingRight="10dp"
                android:paddingTop="10dp" >
            </EditText>
        </RelativeLayout>

        <Button
            android:id="@+id/buttonFb"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/RelativeLayout3"
            android:layout_marginRight="5dp"
            android:background="@drawable/fbbtn" />

        <Button
            android:id="@+id/buttonTweet"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/RelativeLayout3"
            android:layout_toLeftOf="@+id/buttonFb"
            android:background="@drawable/tweetbtn" />

        <Button
            android:id="@+id/buttonMail"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/RelativeLayout3"
            android:layout_toLeftOf="@+id/buttonTweet"
            android:background="@drawable/mailbtn" />
    </RelativeLayout>

</RelativeLayout>
4

0 回答 0