Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 键盘与编辑文本重叠_Android_Scrollview_Android Softkeyboard - Fatal编程技术网

Android 键盘与编辑文本重叠

Android 键盘与编辑文本重叠,android,scrollview,android-softkeyboard,Android,Scrollview,Android Softkeyboard,您好,我有一个包含以下元素的活动 这是我的xml布局: <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:la

您好,我有一个包含以下元素的活动 这是我的xml布局:

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#dddddd">

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#dddddd">

  <TextView android:id="@+id/title"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:text="title"
    android:textSize="@dimen/checkout_title"
    android:textColor="#858585"
    android:textStyle="bold"
    android:layout_margin="10dp" /> 

   <android.support.v4.view.ViewPager     xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/pager"
  android:layout_width="match_parent"
  android:layout_height="474dp"
  android:layout_below="@+id/title"
  android:layout_marginBottom="10dp"></android.support.v4.view.ViewPager>

   <com.pockee.views.CirclePageIndicator android:id="@+id/indicator"
    android:padding="0dp"
    android:layout_height="wrap_content"
    android:layout_width="match_parent" 
    android:layout_below="@+id/pager"
    app:pageColor="#858585"
    app:fillColor="#f19201" />

   <LinearLayout android:layout_below="@+id/indicator"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="10dip"
    android:background="#80000000"
    android:layout_margin="10dp">

    <TextView 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="Value:"
      android:textColor="@color/white" />

    <EditText
      android:id="@+id/value1"
      android:layout_width="fill_parent"
      android:layout_height="40dp"
      android:background="@color/white"
      android:paddingLeft="10dp"
    android:paddingRight="10dp"
    android:inputType="number" />

     <TextView 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="15dip"
      android:text="Value2:"
      android:textColor="@color/white" />

     <EditText
      android:id="@+id/value2"
      android:layout_width="fill_parent"
      android:layout_height="40dp"
      android:password="true"
      android:background="@color/white"
      android:paddingLeft="10dp"
    android:paddingRight="10dp"
    android:inputType="number" />

     <Button 
      android:id="@+id/btn"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="20dip"
      android:text="OK"
      android:background="#f19100"
      android:textColor="@color/white"
      android:textStyle="bold" />

   </LinearLayout>
   </RelativeLayout>
   </ScrollView>
问题是数字键盘与编辑文本重叠了10个像素


关于这个问题有什么想法吗?

我看到你有一个相对布局,它包裹着你的线性布局,但是你的线性布局和相对布局都有10dp的余量。尝试将内部值“LinearLayout”边距编辑为0或将边距全部更改为0,即使用底部边距:0而不是边距并重新加载。

我已删除所有边距,结果也是一样。问题在于编辑文本的背景色
android:windowSoftInputMode="adjustResize|stateVisible"