您的问题是Android开源项目中Android和
already reported and assigned的错误:
您的解决方法可能如下所示:
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">
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 text text text text text text text text text text text text text text text text text"
android:textColor="@color/white"
android:textSize="11sp" />
因此,我们的想法是拥有一个带有填充,边距和背景的包装容器. (如果您只有几个这样的视图,那么性能开销应该不大)
原始的错误答案(虽然有两个TextViews)
问题可能是由于TextView上有如此多的属性组合.以下是一些建议:
>首先尝试逐个删除属性,检查结果
>您可以尝试在容器上指定填充而不是文本视图
>从您的布局看起来您可以尝试这样的事情
而不是文本视图上的“match_parent”: