I want to create a textview with a single line which is inside a swipelayout. Every textview represents an action on which the user can touch. All textviews have a width of 100dp. Now i have the problem that the text of a textview is too long and it wraps to the next line. I don't want to use android:singleLine="true"
. Now i added android:maxLines="1"
and android:inputType="text"
and it works fine. But now i get the warning:
Attribute android:inputtype should not be used with <
TextView
>: Change element type to <EditText
>
I don't want to enter text so i don't need an EditText
.
Is there another way or should i just ignore this warning?
<TextView
android:id="@+id/item_list_bottom_rename"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:inputType="text"
android:layout_gravity="center"
android:drawableTop="@drawable/ic_visibility_white_36dp"
android:gravity="center"
android:padding="10dp"
android:text="@string/rename"
android:textColor="@color/item_title_listname"/>
Solution:
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fillViewport="true"
android:minWidth="100dp"
android:scrollbars="none">
<TextView
android:id="@+id/item_list_bottom_rename"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:drawableTop="@drawable/ic_visibility_white_36dp"
android:gravity="center"
android:maxLines="1"
android:text="@string/rename"
android:textColor="@color/item_title_listname"/>
</HorizontalScrollView>