0

edittext と、レイアウトの edittext の下にあるボタンがあります。

レイアウト xml は次のようになります。

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

    <EditText
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="110dp"
        android:ems="10" >

    </EditText>

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/editText1"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="91dp"
        android:text="Button" />

</RelativeLayout>

androidmanifast での layout のアクティビティは次のとおりです。

      android:name="com....activity.CaptureActivity"
        android:windowSoftInputMode="adjustPan" 

では、質問は:

edittext をクリックまたはフォーカスすると、ソフト入力が自動的に押し上げられ、ボタンがブロック/カバーされたので、ボタンを表示したいと思います。入力が来るときにボタンをソフト入力キーボードの右にするにはどうすればよいですか。

誰かが私にアドバイスをくれますか?ありがとう。

4

2 に答える 2

0

それを維持するためにこれを試してください

android:windowSoftInputMode="adjustPan|stateAlwaysHidden"
于 2015-06-17T04:26:29.097 に答える
-1

以下のように EditText と Button を ScrollView にラップします

<ScrollView>
  <LinearLayout android:orientation="vertical">
    <EditText/>
    <Button/>
  </LinearLayout>
</ScrollView>

于 2015-06-17T04:27:37.093 に答える