gpt4 book ai didi

android - 以固定大小的 TextView 显示字符串

转载 作者:行者123 更新时间:2023-11-29 16:12:15 25 4
gpt4 key购买 nike

我有固定宽度和高度的 TextView,想设置字符串 "._MealTracker_2-MAR-2012_02-20PM.apk" 但在 textview 中只显示 "."无法得到它。为什么会这样?

      <TextView
android:id="@+id/TextView01"
android:layout_width="60dp"
android:layout_height="20dp"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginBottom="@dimen/bottom_margin"
android:text="._MealTracker_2-MAR-2012_02-20PM.apk"
android:textColor="@color/bgblue" />

最佳答案

它没有正确显示,因为 android:singleLine 属性没有设置,所以它考虑 multiline 。因此,您的文本设置为垂直。

如果您设置 android:singleLine="true",则 ._MealT... 会显示在 textView 中。

enter image description here

关于android - 以固定大小的 TextView 显示字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12213973/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com