admin管理员组文章数量:1405170
I'm trying to make a TextInputEditText with maxLines = 10 be scollable in a way that when it's done scrolling, the parent should scroll but I can't get it to work.
The TextInputEditText behaves as if it didn't have anything to scroll. Is this possible to accomplish this?
If I want to scroll the text, I need to click on it first and then drag the handle which is very annoying and bad UX.
Here's what I have:
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android=";
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top|start"
android:inputType="textMultiLine"
android:maxLines="10"
android:overScrollMode="always"
android:scrollbars="vertical" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top|start"
android:inputType="textMultiLine"
android:maxLines="10"
android:overScrollMode="always"
android:scrollbars="vertical" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
本文标签: androidHow to scroll a TextInputEditText inside a ScrollViewNestedScrollViewStack Overflow
版权声明:本文标题:android - How to scroll a TextInputEditText inside a ScrollViewNestedScrollView - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744322391a2600565.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论