'How to make edittext scrollable in android kotlin?
here is XML code:-
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/Description"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="8dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/Description_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/description"
android:inputType="textMultiLine"
android:scrollbars="vertical"
android:enabled="true"
android:maxLines="5"
android:isScrollContainer="true"
android:focusable="true"
/>
</com.google.android.material.textfield.TextInputLayout>
Here is my activity code:-
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_details)
Description_et.movementMethod = ScrollingMovementMethod()
}
I tried using this method but it is not working for me. It is scrollabel using pointer and by selecting text. But I want to scroll it without using pointer.
Can someone please help me?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
