I have a ScrollView
inside which is an EditText
which is set to scroll vertically. But it does not scrolls. Instead the whole layout scrolls, Whene
XML code
android:gravity="top"
android:inputType="text|textMultiLine"
android:lines="5"
Use below code for Kotlin
editText.setOnTouchListener { v, event ->
if (v.id == R.id.editText) {
v.parent.requestDisallowInterceptTouchEvent(true)
when (event.action and MotionEvent.ACTION_MASK) {
MotionEvent.ACTION_UP -> v.parent.requestDisallowInterceptTouchEvent(false)
}
}
false
}