我在 ViewHolder 中有一个可缩放的视图,缩放的工作方式如下:
private void applyScaleAndTranslation() {
child().setScaleX(scale);
child().setScaleY(scale);
child().setTranslationX(dx);
child().setTranslationY(dy);
}
如果视图放在 XML 中,一切正常,但在 RecyclerView 中,我可以看到视图在容器外。
我知道 RecyclerView.ChildDrawingOrderCallback
,我可以更改顺序,但不能禁用它。
是否可以禁用在容器外绘图,或者我可以用另一种方式缩放视图?
像 android:clipChildren="false"
这样的事情没有帮助。
问题截图如下: