2

Edittext をクリックすると、キーボードが表示されます。キーボードがオンのときにまだ表示されているボタンがありますが、クリックできません。「戻る」ボタンを押してキーボードが消えたときにのみ、そのボタンをクリックできます。キーボードが表示されていてもそのボタンをクリックできるようにしたい。この問題は 4 以降の Android バージョンでのみ発生し、古いバージョンではすべて問題ありません。

キーボードが飛び出していても、表示されているボタンをクリックできるようにするにはどうすればよいですか?

コードは次のとおりです。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:mm="http://millennialmedia.com/android/schema"
android:id="@+id/mainLayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ImageView android:id="@+id/topLogo"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:contentDescription="@string/logo_desc"
    android:src="@drawable/top_logo" />      

<EditText
    android:id="@+id/searchField"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_below="@+id/topLogo"
    android:inputType="textPersonName" >
</EditText>   

<Button
    android:id="@+id/searchButton"
    style="?android:attr/buttonStyleSmall"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/searchField"
    android:layout_centerHorizontal="true"
    android:text="@string/search_button_label"  />        

</RelativeLayout>
4

1 に答える 1

0

ターン自身<com.millennialmedia.android.MMAdView/>が問題を引き起こしていました。他のすべてのコンポーネントと同じ RelativeLayout にありました。MMAdView をメイン レイアウト内の別のレイアウトに配置すると、問題が解決しました。

于 2012-10-07T18:14:51.197 に答える