颤振给容器圆形边框 [英] Flutter give container rounded border
本文介绍了颤振给容器圆形边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在做容器,给它加了一个边框,但是倒圆角的边框我会很高兴。
I'm making container, I gave it a border, but I would be nice to have rounded borders.
这就是我现在拥有的(见图)
This is what I have now (see image)
https: //drive.google.com/file/d/1AJ8ytjuUBCDX6mLBE3jmNyJdt7lTGBeW/view?usp=sharing
Container(
width: screenWidth / 7,
decoration: BoxDecoration(
border: Border.all(
color: Colors.red[500],
),
),
child: Padding(
padding: EdgeInsets.all(5.0),
child: Column(
children: <Widget>[
Text(
'6',
style: TextStyle(
color: Colors.red[500],
fontSize: 25),
),
Text(
'sep',
style: TextStyle(
color: Colors.red[500]),
)
],
),
),
);
我曾尝试在其上放上夹子,但这使边界变了。有解决方案吗?预先谢谢!!!!
I tried putting cliprrect on it, but that crops the border away. Is there a solution for this? Thanks in advance!!!
推荐答案
尝试使用属性 borderRadius
BoxDecoration
类似
Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.red[500],
),
borderRadius: BorderRadius.all(Radius.circular(20))
),
child: ...
)
这篇关于颤振给容器圆形边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文