I have been trying to make an scrollable EditText work properly and thanks to this post it almost works but I am facing this problem now:
Scrolling works fine in the EditText while there are less than 6 lines, when you start adding more lines scrolling gets crazy and the scroll of the ScrollView starts moving.
Here is the EditText code:
<!-- Details Field -->
<EditText
android:id="@+id/details_value"
android:layout_width="fill_parent"
android:layout_height="100dp"
android:gravity="top|left"
android:hint="@string/hint_details"
android:maxLength="250"
android:scrollbars="vertical" />
And this is the code I use to enable scrolling inside the EditText:
detailsEditText = (EditText) findViewById(R.id.details_value);
detailsEditText.setOnTouchListener(new View.OnTouchListener()
{
@Override
public boolean onTouch(final View v, final MotionEvent motionEvent) {
if (v.getId() == R.id.details_value) {
v.getParent().requestDisallowInterceptTouchEvent(true);
switch (motionEvent.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_UP:
v.getParent().requestDisallowInterceptTouchEvent(
false);
break;
}
}
return false;
}
});
Any help?