大佬教程收集整理的这篇文章主要介绍了如何修复文本溢出TextView与填充android:ellipsize =“marquee”,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
三星Galaxy S3和S6分别不会出现在Android K和L上.
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="1dp" android:paddingTop="2dp" android:paddingBottom="2dp" android:paddingLeft="4dp" android:paddingRight="4dp" android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:freezesText="true" android:alpha="0.85" android:BACkground="@color/by433_gray_darker" android:textColor="@color/white" android:textSize="11sp" />
您的解决方法可能如下所示:
<FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingTop="2dp" android:paddingBottom="2dp" android:paddingLeft="4dp" android:paddingRight="4dp" android:layout_marginBottom="1dp" android:BACkground="@color/by433_gray_darker"> <TextView android:id="@+id/textId" android:layout_width="match_parent" android:layout_height="wrap_content" android:singleLine="true" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally="true" android:freezesText="false" android:alpha="0.85" android:text="super nice @R_276_3801@ @R_276_3801@ @R_276_3801@ @R_276_3801@ @R_276_3801@ @R_276_3801@ @R_276_3801@ @R_276_3801@ text" android:textColor="@color/white" android:textSize="11sp" /> </FrameLayout>
因此,我们的想法是拥有一个带有填充,边距和背景的包装容器. (如果您只有几个这样的视图,那么性能开销应该不大)
原始的错误答案(虽然有两个TextViews)
问题可能是由于TextView上有如此多的属性组合.以下是一些建议:
>首先尝试逐个删除属性,检查结果
>您可以尝试在容器上指定填充而不是文本视图
>从您的布局看起来您可以尝试这样的事情
而不是文本视图上的“match_parent”:
<LinearLayout android:orientation="horizontal" ...> <TextView android:layout_width="0dp" android:layout_weight="1" ... /> <TextView android:layout_width="0dp" android:layout_weight="1" ... /> </LinearLayout>
以上是大佬教程为你收集整理的如何修复文本溢出TextView与填充android:ellipsize =“marquee”全部内容,希望文章能够帮你解决如何修复文本溢出TextView与填充android:ellipsize =“marquee”所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。