我创建了一个滚动视图,中间有一个多行(可滚动)的 EditText。当编辑该视图并添加超出允许高度的行时,它会按预期滚动。但是,整个容器的父滚动视图也会像跟随文本一样滚动。
<ScrollView
p1:minWidth="25px"
p1:minHeight="25px"
p1:layout_width="match_parent"
p1:layout_height="match_parent"
p1:background="#F7F3DE"
p1:id="@+id/scrollview">
<RelativeLayout
p1:layout_width="match_parent"
p1:layout_height="match_parent"
p1:clickable="true"
p1:focusableInTouchMode="true"
p1:id="@+id/realtiveLayout">
<EditText
p1:id="@+id/editText"
p1:focusableInTouchMode="true"
p1:layout_width="match_parent"
p1:layout_height="150dp"
p1:hint="Comments"
p1:background="#00000000"
p1:textSize="16sp"
p1:textColor="#555555"
p1:gravity="top"
p1:minLines="5"
p1:maxLines="5"
p1:inputType="textCapSentences|textMultiLine"
p1:scrollHorizontally="false"
p1:layout_marginTop="5dp"
p1:textColorHint="#A9A9A9" />
</RelativeLayout>
</ScrollView>
Run Code Online (Sandbox Code Playgroud)
有没有人看到或知道这个问题的解决方案?
(注意:这不是我已经理解的如何通过触摸滚动一个而不是另一个的问题。这是一个在 EditText 内键入时主滚动视图移动的问题,即使文本没有降低而是滚动.