android虚拟键盘更改按钮的位置,并将其置于焦点上的编辑文本上

android虚拟键盘更改按钮的位置,并将其置于焦点上的编辑文本上,android,android-layout,android-softkeyboard,Android,Android Layout,Android Softkeyboard,我已经创建了一个应用程序,其中有一个edittext从用户那里获取输入,下面有一个按钮。当用户点击或聚焦编辑文本以输入内容时,键盘会改变按钮位置,并与编辑文本重叠。我已尝试了 回答。但这对我没有帮助 我用过这个 android:windowSoftInputMode="stateVisible|adjustNothing 请找个人来 编辑: 这是我的布局xml <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:a

我已经创建了一个应用程序,其中有一个edittext从用户那里获取输入,下面有一个按钮。当用户点击或聚焦编辑文本以输入内容时,键盘会改变按钮位置,并与编辑文本重叠。我已尝试了
回答。但这对我没有帮助

我用过这个

android:windowSoftInputMode="stateVisible|adjustNothing
请找个人来

编辑: 这是我的布局xml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   xmlns:ads="http://schemas.android.com/apk/res-auto"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:fillViewport="true" 
   android:background="#ffffff"
   tools:context=".MyAds"
   android:id="@+id/TestAd"
  >


<RelativeLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff"
     >

    <EditText
        android:id="@+id/edtLoanAmount"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/txtLoanAmount"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/txtLoanAmount"
        android:ems="10"

        android:background="@drawable/rounded_edittext_states"
        android:inputType="numberDecimal" />

    <EditText
        android:id="@+id/edtRateOfInterest"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/txtRateOfInerest"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/txtRateOfInerest"
        android:ems="10"

        android:background="@drawable/rounded_edittext_states"
        android:inputType="numberDecimal" />

    <TextView
        android:id="@+id/txtRateOfInerest"
        android:textColor="#000000"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/edtLoanAmount"
        android:layout_below="@+id/edtLoanAmount"
        android:layout_marginTop="14dp"
        android:text="Rate of Inerest"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/txtLoanAmount"
        android:textColor="#000000"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="16dp"
        android:text="Enter Loan Amount"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <TextView
        android:id="@+id/txtLoanTenure"
        android:textColor="#000000"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/edtRateOfInterest"
        android:layout_marginTop="16dp"
        android:text="Loan Tenure (In Months)"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <EditText
        android:id="@+id/edtLoanTenure"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/txtLoanTenure"
        android:ems="10"

        android:background="@drawable/rounded_edittext_states"
        android:inputType="number" />

    <TextView
        android:id="@+id/txtEMI"
        android:textColor="#000000"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/btnCalculateEmi"
        android:layout_marginTop="20dp"

        android:gravity="center"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <Button
        android:id="@+id/btnLoanAmorSchedule"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/txtEMI"
        android:layout_marginTop="16dp"

        android:background="@drawable/rounded_button_states"
        android:text="Loan Amortization Schedule" />

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="125dp"
        android:layout_height="50dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:src="@drawable/initqube" />

     <Button
        android:id="@+id/btnCalculateEmi"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:paddingTop="3dp"  
        android:layout_marginTop="5dp"
        android:layout_below="@id/edtLoanTenure"
        android:background="@drawable/rounded_button_states"
        android:text="Calculate EMI" />

     <com.google.android.gms.ads.AdView
         android:id="@+id/MyAdView"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_above="@+id/imageView1"
         android:layout_alignParentLeft="true"
         ads:adSize="BANNER"
         ads:adUnitId="xxxxxxxxx" >
     </com.google.android.gms.ads.AdView>

</RelativeLayout>
</ScrollView>

我的问题已经解决

<Button
        android:id="@+id/btnCalculateEmi"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:paddingTop="3dp"  
        android:layout_marginTop="5dp"
        android:layout_below="@id/edtLoanTenure"
        android:background="@drawable/rounded_button_states"
        android:text="Calculate EMI" />

从按钮属性。一切都像一个魅力…

添加
android:windowSoftInputMode=“adjustPan”


在您的
活动的
Android清单XML
文件中

请在此处显示您的XML布局…。@umair.ali我已经显示了我的布局XML。。。
android:layout_centerVertical="true"