I want to do scroll when the EditText is disabled and contains a large text in 1 line.
I try edittext.setInputType(InputType.TYPE_NULL)
but background don't change, and users can not tell the difference when they can edit or not.
EDIT: my xml:
<EditText
android:id="@+id/et_address"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="text"
android:maxLength="120"
android:maxLines="1"
android:singleLine="true"
android:nextFocusDown="@+id/et_name" />
the horizontal scroll works fine when edittext is enable, i want the same when edittext turn disabled
Better use textview and set background like edittext using XML style
<TextView
android:id="@+id/output"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
android:layout_marginTop="2dp"
android:layout_weight="1"
android:background="@drawable/btnstyle"
android:hint="@string/convert"
android:inputType="number"
android:textColor="#000000"
android:scrollbars="horizontal"
android:scrollHorizontally="true"
android:gravity="left|center"
android:textSize="18sp"
/>
and set
Output = (TextView) findViewById(R.id.output);
Output.setMovementMethod(new ScrollingMovementMethod());
Hope this Helpful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With