如何将盒子阴影应用于类似于高架按钮的容器或在颤动上实现的CSS?

发布于 2025-02-03 18:34:43 字数 224 浏览 4 评论 0原文

我一直在努力实现这一目标,因为所有Box Shadow Solutions都不合适! Bellow是我想拥有的结果:

I have been struggling a lot to achieve this, for all box shadow solutions are just not suitable! Bellow is the result I want to have:
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

打小就很酷 2025-02-10 18:34:43

只需按照下面的方式添加:

                          Container(
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(10),
                              image: DecorationImage(
                                image: CachedNetworkImageProvider('your_image'),
                                fit: BoxFit.cover,
                              ),
                              boxShadow: const [
                            BoxShadow(
                              color: Color.fromARGB(255, 0, 0, 0),
                              blurRadius: 2.0,
                              spreadRadius: 0.0,
                              offset: Offset(1, 1), //
                            ),
                          ]));

Just add it like below:

                          Container(
                          decoration: BoxDecoration(
                              borderRadius: BorderRadius.circular(10),
                              image: DecorationImage(
                                image: CachedNetworkImageProvider('your_image'),
                                fit: BoxFit.cover,
                              ),
                              boxShadow: const [
                            BoxShadow(
                              color: Color.fromARGB(255, 0, 0, 0),
                              blurRadius: 2.0,
                              spreadRadius: 0.0,
                              offset: Offset(1, 1), //
                            ),
                          ]));
⒈起吃苦の倖褔 2025-02-10 18:34:43

请将您的容器小部件包装在卡中,并使用卡的高程属性。

Kindly wrap your container widget in card and use elevation property of card.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文