Flutter:ClipRRect与具有BoxDecoration的容器 [英] Flutter: ClipRRect vs Container with BoxDecoration

查看:336
本文介绍了Flutter:ClipRRect与具有BoxDecoration的容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道ClipRRect还有其他选项,例如自定义Clipper。但是,如果我只需要一个简单的边界半径,性能会有什么不同吗?

I know that ClipRRect has additional options like custom clipper. But if I need just a simple border radius is there any performance difference? Which one is more recommended?

推荐答案

如果目标是创建圆形边界,则只能在最后一种情况下使用快船,当容器可能无济于事时。例如,图像可以绘制圆形边界,因此除非裁剪图像,否则您别无选择。

If your goal is to create a rounded border, you must use clippers only in the last situation, when containers may not help. For example, images can draw over rounded borders, so you have no other option unless clipping the image.

这篇关于Flutter:ClipRRect与具有BoxDecoration的容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆