本文介绍了如何使按钮的角仅在顶部变圆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个顶部有圆角和底部有普通角的按钮.我怎样才能做到这一点?

I'm trying to make a button which has rounded corners on the top and a normal corner on the bottom. How can I make it like this?

推荐答案

一般示例:

RaisedButton(
              onPressed: () {},
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.only(
                      topLeft: Radius.circular(15.0),
                      topRight: Radius.circular(15.0))),
              child: Text('Click Me!'),
              color: Colors.blueAccent,
              textColor: Colors.white,
            ),

根据 pskink 评论:

As Per pskink Comment :

RaisedButton(
              onPressed: () {},
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.vertical(
                top: Radius.circular(15.0),
              )),
              child: Text('Click Me!'),
              color: Colors.blueAccent,
              textColor: Colors.white,
            ),

这篇关于如何使按钮的角仅在顶部变圆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-23 05:34