英文:
How to prevent TextView from being truncated
问题
我在一个ListView上面有一个TextView,一旦ListView的高度达到与屏幕相同的高度(即一些列表项需要滚动才能看到的时候),TextView就会变成“...”。
有没有办法阻止这种情况发生?
编辑:
嗯,这有点尴尬...
问题是服务器返回的是'...',而不是正确的字符串,为此造成的不便我深感抱歉!
英文:
I have a TextView above a listView, and once the listView reaches the same height as the screen,(the moment some of the list items need to be scrolled-to to be seen) the text view turns into "..."
is there any way to prevent this from happening?
EDIT:
well, this is embarrassing...
the problem was that the server was returning '...' instead of the proper string, sorry for the inconvenience!
答案1
得分: 0
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/color_white"
android:layout_height="match_parent"
tools:context=".AffectedCountries">
<TextView
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_margin="10dp"
android:text="搜索"
android:textSize="40dp"
/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/edtSearch"
android:layout_margin="5dp"
android:padding="5dp"
android:id="@+id/recyclerAffectedCountries">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
英文:
your question is no clear. i use recycler view hope this code will help you
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@color/color_white"
android:layout_height="match_parent"
tools:context=".AffectedCountries">
<TextView
android:layout_width="match_parent"
android:layout_height="45dp"
android:layout_margin="10dp"
android:text="search"
android:textSize="40dp"
/>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/edtSearch"
android:layout_margin="5dp"
android:padding="5dp"
android:id="@+id/recyclerAffectedCountries">
</androidx.recyclerview.widget.RecyclerView>
</RelativeLayout>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论