一直在查看文档,但无法找到如何正确掩盖kv中的图像。这是我的kv代码:
<MyImage@AsyncImage>:
source: 'http://webserver/120x100.png'
canvas.before:
StencilPush
RoundedRectangle:
size: 120,100
答案 0 :(得分:2)
您可能需要调用StencilUse来使用模板层。还记得不要使用和弹出:
<MyImage@AsyncImage>:
source: 'http://webserver/120x100.png'
canvas.before:
StencilPush
RoundedRectangle:
size: 120,100
StencilUse
canvas.after:
StencilUnUse
StencilPop