对视图边界之外执行静态转换
一个简单的问题是,自定义 ViewGroup 是否可以覆盖
protected boolean getChildStaticTransformation(View child, Transformation t)
并让转换将视图绘图放置在 viewGroups 边界之外?
我以为我看到了一种与以这种方式切换剪辑有关的方法,但不确定我是否已经弥补了!
目前,我正在根据需要增加 viewGroup 的填充并调用 setClipToPadding(false) 以便我可以在填充区域中进行绘制。
谢谢
A quick question, is it possible for a custom ViewGroup to override
protected boolean getChildStaticTransformation(View child, Transformation t)
and have transformation place the view drawing outside of the viewGroups bounds?
I thought i saw a method relating to toggling clipping in this way but not sure if i have made it up!
At the moment I am increading the padding of the viewGroup as needed and calling setClipToPadding(false)
so i can draw in the padding region.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
啊哈,找到了!
以防万一其他人想知道, android:clipChildren 属性就是我想要的。
我想如果您选择使用自定义动画,那么您也应该覆盖
Animation.willChangeBounds
。编辑:我发现当
clipChildren
似乎不起作用时,只需使父级无效就可以解决问题(比如在驱动帧动画的Runnable
内部)Aha, found it!
Just in case anyone else wantes to know, the android:clipChildren attribute of ViewGroup is what i want.
I imagine if you go the route of using a custom Animation then you should override the
Animation.willChangeBounds
also.EDIT: I found that when
clipChildren
does not seem to work then just invalidating the parent can do the trick (say inside aRunnable
driving a frame animation)