how to make textview scrollable inside scroll view
<AppCompatTextView
android:id="@+id/actv"
...
android:scrollbars="vertical" />
how to make textview scrollable inside scroll view
<AppCompatTextView
android:id="@+id/actv"
...
android:scrollbars="vertical" />
how to make textview scrollable inside scroll view
/**
* If this [AppCompatTextView] is placed inside ScrollView then we allow it get scrolled inside
* that ScrollView
*/
fun AppCompatTextView.makeScrollableInsideScrollView() {
movementMethod = ScrollingMovementMethod()
setOnTouchListener { v, event ->
v.parent.requestDisallowInterceptTouchEvent(true)
when (event.action and MotionEvent.ACTION_MASK) {
MotionEvent.ACTION_UP -> {
v.parent.requestDisallowInterceptTouchEvent(false)
//It is required to call performClick() in onTouch event.
performClick()
}
}
false
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us