0

Swype キーボードのように、IMEの ListView を画面の中央に「浮かせる」ようにしようとしています。

ここに画像の説明を入力

FrameLayout を使用してアクティビティでそれを行う方法を読みましたが、アクティビティではなくサービスである IME では機能しません。私の入力ビューは、ルート ビューとしての FrameLayout、複数のコントロールを含む子 RelativeLayout、および FrameLayout の子でもある ListView で構成されます。ここに私のレイアウトコードがあります:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="fill_parent" 
              android:layout_height="wrap_content"
              android:layout_gravity="bottom" 
              android:gravity="center_horizontal" >

    <!-- Most of the controls are children of this RelativeLayout -->
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="fill_parent" 
                  android:layout_height="wrap_content"
                  android:gravity="center" >

        <Button android:id="@+id/btnOption1"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_marginRight="10dp" 
                android:layout_alignParentLeft="true"
                android:layout_toLeftOf="@+id/imgArrow"
                android:layout_marginTop="10dp" 
                android:textSize="18dp"
                android:textColor="#ffffff"
                android:background="@drawable/button"
                android:padding="4dp"
                android:text="Option 1" />

        <ImageView android:id="@id/imgArrow"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_marginRight="10dp" 
                android:layout_centerHorizontal="true"
            android:layout_alignBottom="@id/btnOption1"
                android:layout_marginTop="10dp" 
                android:padding="4dp"
                android:src="@drawable/arrow_right" />

        <Button android:id="@+id/btnOption2"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_toRightOf="@id/imgArrow"
                android:layout_marginTop="10dp" 
                android:textSize="18dp"
                android:textColor="#ffffff"
                android:background="@drawable/button"
                android:padding="4dp"
                android:text="Option 2" />

    <!-- Translate button -->
    <Button android:id="@+id/btnContinue"
            android:layout_width="fill_parent" 
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_below="@id/imgArrow"
            android:layout_marginTop="10dp" 
            android:layout_marginBottom="10dp" 
            android:textSize="22dp"
            android:textColor="#ffffff"
            android:background="@drawable/button"
            android:text="Translate!" />

        <!-- Keyboard button -->
        <ImageButton android:id="@+id/btnKeyboard"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_below="@id/btnContinue"
                android:layout_marginRight="4dp" 
                android:textColor="#ffffff"
                android:background="@drawable/button"
                android:src="@drawable/sym_keyboard_kb" />

        <!-- Undo button -->
        <ImageButton android:id="@+id/btnUndo"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_below="@id/btnContinue"
                android:textColor="#ffffff"
                android:background="@drawable/button"
                android:src="@drawable/sym_keyboard_undo" />

    </RelativeLayout>

<ListView android:id="@+id/menuOptions"
          style="@style/optionsMenu" />

</FrameLayout>

ListView と IME は次のようになります (SMS アプリ内)。

ここに画像の説明を入力

しかし、私はそれを次のようにしたい:

ここに画像の説明を入力

つまり、IME入力ビューのに表示したいのです。Swype がそれを実行できるなら、私もできると思います (ちょっとした助けがあれば)。助言がありますか?

前もって感謝します!バリー

4

1 に答える 1

1

問題の解決策を見つけ、別のスレッドに回答を投稿しました: Android IME: TextView にテキストを入力できるカスタム ポップアップ ダイアログ (Swype キーボードなど) を表示する

バリー

于 2011-05-29T09:22:32.187 に答える