我已经尝试了很多解决方案,maxLine,maxLenght,marqueeAlwaysShowing,椭圆尺寸和marquee..the可聚焦的东西.我不能就这么让它起作用。
我删除了所有额外的XML以使其正常工作,这就是我所拥有的:
<LinearLayout
android:id="@+id/promptDefine"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<TextView
android:id="@+id/counterDefinitionName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:clickable="true"
android:onClick="nameCounting"
android:text="@string/nameIt"
android:textColor="@color/count_item_to_be_defined"
/>
</LinearLayout>那么,我应该在textview中添加什么来将文本限制为10个字符呢?但是如果他们更多的只是插入“.”在最后。我已经试过了一些事情,比如:
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"而且不起作用了,提前谢谢!
编辑:
也许是可点击的特性属性搅乱了这一切?
发布于 2013-04-23 21:06:59
这三个点只显示当textView没有足够的空间为字符。
在您的情况下,只需设置一个固定宽度和单行。那就应该管用了。
<TextView android:id="@+id/counterDefinitionName"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:clickable="true"
android:onClick="nameCounting"
android:text="@string/nameIt"
android:singleLine="true"
android:textColor="@color/count_item_to_be_defined" />发布于 2013-04-23 21:04:28
不是“可点击”,而是“选择”
https://stackoverflow.com/questions/16178776
复制相似问题