在包含滚动型活动强制adjustPan [英] Forcing adjustPan in activity containing ScrollView

查看:100
本文介绍了在包含滚动型活动强制adjustPan的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的布置是这样的:

<RelativeLayout>
    <RelativeLayout>
    </RelativeLayout>
    <ViewFlipper>
        <ScrollView>
            <LinearLayout>
                <EditText />
            </LinearLayout>
        </ScrollView>
    </ViewFlipper>
    <RelativeLayout>
    </RelativeLayout>
</RelativeLayout>

在专注于的EditText在中间,软键盘弹出如预期,但是它总是调整大小,即使我有布局安卓windowSoftInputMode =adjustPan在清单中。

When focused on the EditText in the middle, the soft keyboard pops up as expected, However it always resizes the layout even though I have android:windowSoftInputMode="adjustPan" in the manifest.

通过调整大小的问题是,只有滚动型缩小,留下的上方和下方完好RelativeLayouts,几乎可以完全隐藏的EditText。

The problem with resizing is that only the ScrollView shrinks, leaving the RelativeLayouts above and below it intact, which can almost completely obscure the EditText.

我试图隐藏键盘显示时的RelativeLayouts(这是另一个悲伤的故事),但adjustPan听起来更适合。然而,对这种活动没有影响。

I've tried hiding the RelativeLayouts when the keyboard is shown (that's another sad story), but adjustPan sounds more suitable. However it has no effect on this activity.

我如何可以强制adjustPan尽管滚动型的presence工作?

How can I force adjustPan to work despite the presence of the ScrollView?

更新:

所以不会让我回答我的问题,但解决的办法是设置机器人:isScrollContainer =假上的滚动型

SO won't let me answer my own question, but the solution is setting android:isScrollContainer="false" on the ScrollView.

推荐答案

好问题主要是开发者做同样的事情,但是这不是你需要做一个正确的方法。这将帮助你。

Good question mostly Developers do the same thing but this is not a correct way you have need to do. This will help you.

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


<ViewFlipper>
    <ScrollView
      android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       >
        <LinearLayout
          android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:orientation="vertical"
        >
            <EditText />
        </LinearLayout>
    </ScrollView>
</ViewFlipper>
<LinearLayout> 

您应该采取的LinearLayout与方向为垂直或水平视图,你从来没有调整问题created.this是很简单的。

You should take LinearLayout with orientation as Vertical or horizontal view where you have never adjustment problem created.this is very simple.

这篇关于在包含滚动型活动强制adjustPan的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆