Проверьте мое расположение: нижняя кнопка продолжает подходить по клавиатуре

У меня есть расположение, которое делает почти, что я хочу. Существует всего одна ошибка относительно кнопки внизу. Я должен остаться внизу в любом случае. Но каждый раз, когда я поднимаю программируемую клавиатуру, кнопка будет отображена выше клавиатуры. Это не то, что я хочу, но это должно стать покрытым клавиатурой.

Кроме того, я был бы счастлив, если Вы могли бы прокомментировать, как расположение создало.

Спасибо, steff

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">

<LinearLayout android:id="@+id/l_layout_tags"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <TextView
        android:text="TAGS:"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <AutoCompleteTextView android:id="@+id/actv_tags"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:imeOptions="actionDone" />
    <ImageButton android:id="@+id/btn_add_tag"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@android:drawable/ic_input_add"
        android:onClick="addTag"/>
</LinearLayout>

<ScrollView android:id="@+id/sv_scroll_contents"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@id/l_layout_tags"
    android:scrollbarFadeDuration="2000" >
    <TableLayout android:id="@+id/t_layout_contents"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:stretchColumns="1"
        android:paddingRight="5dip">
        <TableRow android:id="@+id/tr_template">
            <ImageView android:id="@+id/iv_blank"
                android:src="@android:color/transparent" />
            <EditText android:id="@+id/et_content1"
                android:gravity="top"
                android:maxWidth="200dp"
                android:imeOptions="actionDone" />
        </TableRow>
    </TableLayout>
</ScrollView>

<LinearLayout android:id="@+id/l_layout_media_btns"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:layout_centerHorizontal="true"
    android:layout_below="@id/sv_scroll_contents" >
    <ImageButton android:id="@+id/btn_camera"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@android:drawable/ic_menu_camera"
        android:onClick="takePicture" />
    <ImageButton android:id="@+id/btn_video"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@android:drawable/ic_menu_camera" />
    <ImageButton android:id="@+id/btn_audio"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@android:drawable/ic_btn_speak_now" />
    <ImageButton android:id="@+id/btn_sketch"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@android:drawable/ic_menu_edit" />
</LinearLayout> 

<ImageButton android:id="@+id/btn_save_note"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:src="@android:drawable/ic_menu_upload" />

</RelativeLayout>
15
задан stfn 12 March 2010 в 14:40
поделиться

1 ответ

Добавьте android: windowSoftInputMode = "adjustPan" в свой тег активности в AndroidManifest.xml.

Таким образом, программная клавиатура не изменит размер вашей раскладки, и ваша кнопка останется под ней. Посмотрите здесь , чтобы получить лучшее представление о различных режимах программной клавиатуры.

56
ответ дан 1 December 2019 в 00:05
поделиться
Другие вопросы по тегам:

Похожие вопросы: