1

私はアンドロイドが初めてです。グーグルマップを使ったアプリを作っています。レイアウト ファイルの 3 つの部分、つまり、トップ レイヤー、ミッド レイヤー、ボトム レイヤー。最上層にヘッダー、最下層に TAB ボタン。ミッドレイヤーフラグメントと編集テキスト。編集ボックスをクリックすると、フラグメントが上がりました。フラグメントがその位置に戻ると、最上層は見えなくなります。何が起こるかわかりません。

<RelativeLayout 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:background="@drawable/bg"
tools:context=".MainActivity" >

<RelativeLayout
    android:id="@+id/topLay"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/jam_alert_topbar"
     >
</RelativeLayout>

<RelativeLayout
    android:id="@+id/midLay"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_above="@+id/botLay"
    android:layout_below="@+id/topLay"
    android:layout_margin="10dp" >

    <fragment
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@+id/descr"
        android:layout_below="@+id/topLay"
        class="com.google.android.gms.maps.SupportMapFragment" />

    <EditText
        android:id="@+id/descr"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_marginTop="5dp"
        android:background="@color/white"
        android:gravity="top|left"
        android:hint="Description"
        android:maxLines="4"
        android:minLines="4" >
    </EditText>
</RelativeLayout>

<LinearLayout
    android:id="@+id/botLay"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:gravity="center" >

    <Button
        android:id="@+id/btReport"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/jam_tab_n"
        android:onClick="btReport" />

    <Button
        android:id="@+id/btMap"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/map_tab_h"
        android:onClick="btMap" />

    <Button
        android:id="@+id/btHome"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/report_tab_n"
        android:onClick="btHome" />

    <Button
        android:id="@+id/btSetting"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/settings_tab_n"
        android:onClick="btSetting" />
</LinearLayout>

4

2 に答える 2

1

これを試してみてください。これを試しましたか? 特定のアクティビティに windowSoftInputMode 属性を追加する

android:windowSoftInputMode="adjustPan"

あなたのxmlで。一番上の相対レイアウトに android:layout_alinParentTop="true" を追加します

 <RelativeLayout
android:id="@+id/topLay"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/jam_alert_topbar"
android:layout_alinParentTop="true"
 >
</RelativeLayout>
于 2013-10-10T11:07:01.947 に答える