Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.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_Android Layout_Android Viewpager_Android Softkeyboard - Fatal编程技术网

Android 出现软键盘时布局未向上推

Android 出现软键盘时布局未向上推,android,android-layout,android-viewpager,android-softkeyboard,Android,Android Layout,Android Viewpager,Android Softkeyboard,我有一个给定布局层次结构的片段 在查看页面中,我有一个编辑文本。当键盘显示为键入文本以编辑文本时,整个布局不会向上推。取而代之的是,ViewPager中的内容被向上推。我希望当键盘出现时,外部线性布局中的所有内容都向上推 我怎样才能做到这一点 谢谢。将您的父线性布局放在滚动视图中。这解决了我的问题。在活动的清单条目中,添加 <activity ... android:windowSoftInputMode="adjustPan"> 将基本布局放在滚动视图中 //在这里做布局工作

我有一个给定布局层次结构的片段

在查看页面中,我有一个编辑文本。当键盘显示为键入文本以编辑文本时,整个布局不会向上推。取而代之的是,ViewPager中的内容被向上推。我希望当键盘出现时,外部线性布局中的所有内容都向上推

我怎样才能做到这一点


谢谢。

将您的父线性布局放在滚动视图中。这解决了我的问题。

在活动的清单条目中,添加

<activity ...
android:windowSoftInputMode="adjustPan">

将基本布局放在滚动视图中


//在这里做布局工作

请记住,scrollView不能用作基本布局,因此您必须将scrollView放在LinearLayout或RelativeLayout内。

您在活动中设置了哪个
WindowsofInputMode
?请参见此处:android:WindowsOfInputMode=“adjustPan”>将尝试向上移动整个布局,而不是重新调整其大小。您好,这对我很有用。谢谢
  <ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:id="@+id/llPlayersName"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
         >
        // do here the layout work
    </LinearLayout>

</ScrollView>