0

私は EditText を持っており、クリックするとテンキーが上にスライドしandroid:inputType="number"ます。これが発生すると、上記の TextViews が画面から押し出されます。テンキーを常に表示する方法があるかどうか疑問に思っていました (その後、すべての位置を固定できます)。

(私はアクティビティに多くを持っていないので、スペースを節約しようとしているわけではありません。) 入力に基づいて更新されるため、画面から押し出された TextView をユーザーが確認できるようにしたいと考えています。これは次のようになります。

<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"
    tools:context=".Name" >

// TextViews that get pushed off

<EditText
    android:id="@+id/editText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_marginBottom="71dp"
    android:layout_toLeftOf="@+id/enter_input"
    android:ems="10"
    android:inputType="number" >

    <requestFocus />
</EditText>

</RelativeLayout>

これは可能ですか?または、すべてが画面に表示され、何も隠されないようにするより良い方法はありますか?

4

1 に答える 1

1

android:windowSoftInputMode="stateAlwaysVisible"AndroidManifest.xml のアクティビティに追加して、キーボードが常に表示されるようにすることができます。

<activity android:name="[activity_path]" android:windowSoftInputMode="stateAlwaysVisible"/>
于 2012-12-16T21:05:38.257 に答える