我需要在标签中显示字符串“hello i is programmer and make app for android”并使其符合标签宽度,如果字符串大于标签
示例显示“如果字符串大于标签宽度
,请问我是程序员并制作应用程序...”答案 0 :(得分:1)
initialState
答案 1 :(得分:0)
试试这个:
<TextView
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/red"
android:ellipsize="end" //add this
android:maxLines="1" //add this
android:padding="5dp"
android:scrollHorizontally="true"
android:text="hello i am programmer and make app for android"
android:textColor="@color/Black" />