文本视图省略号-字幕滞后



我有一个电视应用程序。这是列表中的一项。一旦某个项目聚焦,我就会缩放它(尝试使用v.animate.scale和后倾行效果进行缩放->ListRowPresenter(FocusHighlight.ZOOM_FACTOR_SMALL)因此,在缩放我的文本视图的任何方法之后,都会在ellipsize="marquee"期间开始滞后。我100%确信它是连接的,因为一旦禁用缩放就可以完美工作。也许有人看到了类似的问题?有什么可能的方法来解决这个ANDROID错误?

<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout
android:id="@+id/main_container"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layoutDirection="ltr"
android:padding="1dp">
<RelativeLayout
android:id="@+id/..."
android:layout_width="wrap_content"
android:layout_height="wrap_content">
...
</RelativeLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/..."
android:layout_alignStart="@+id/..."
android:layout_alignEnd="@+id/..."
android:orientation="vertical">
<TextView <!--HERE!!!!!-->
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:gravity="center_horizontal"
android:paddingTop="2dp"
android:singleLine="true"
android:text="Name"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
</RelativeLayout>
</layout>

如果有人需要解决方案,只需忽略文本(容器)的比例

var parentScale:Float = 1f
baseView.animate().scaleX(parentScale)
baseView.animate().scaleY(parentScale)
val childScale: Float = 1.0f / parentScale
ignoreView?.animate()?.scaleX(childScale)
ignoreView?.animate()?.scaleY(childScale)

文本滚动没有任何滞后。

最新更新