RecyclerView 中的可缩放视图

时间:2021-07-30 14:02:45

标签: java android kotlin android-recyclerview scale

我在 ViewHolder 中有一个可缩放的视图,缩放的工作方式如下:

private void applyScaleAndTranslation() {
     child().setScaleX(scale);
     child().setScaleY(scale);
     child().setTranslationX(dx);
     child().setTranslationY(dy);
}

如果视图放在 XML 中,一切正常,但在 RecyclerView 中,我可以看到视图在容器外。

我知道 RecyclerView.ChildDrawingOrderCallback,我可以更改顺序,但不能禁用它。

是否可以禁用在容器外绘图,或者我可以用另一种方式缩放视图?

android:clipChildren="false" 这样的事情没有帮助。

问题截图如下:

The views overlap and clip into each other.

0 个答案:

没有答案
相关问题