[英]How do you add only a top and bottom border to a TextButton in flutter/dart?
How do you add only a top and bottom border to a TextButton in flutter/dart?如何在 flutter/dart 中仅向 TextButton 添加顶部和底部边框?
TextButton(
onPressed: () {},
child: Text('Button'),
);
You can wrap the TextButton
with a Container
and set the decoration
:您可以用Container
包装TextButton
并设置decoration
:
Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(width: 1.0, color: Colors.grey),
bottom: BorderSide(width: 1.0, color: Colors.grey),
),
),
child: TextButton(
onPressed: () {},
child: Text('Button'),
),
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.