Basically in Android, nested scroll-able components are not recommended, but you can use below snippet ::
textView.setOnTouchListener(new ListView.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
// Disallow ScrollView to intercept touch events.
v.getParent().getParent().getParent()
.requestDisallowInterceptTouchEvent(true);
break;
case MotionEvent.ACTION_UP:
// Allow ScrollView to intercept touch events.
v.getParent().getParent()
.requestDisallowInterceptTouchEvent(false);
break;
}
return true;
}
});
And then put, setOnClickListener for the same textView, then textview be scrollable also be clicable.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…