android - Flutter - 摆脱 iOS 上的阴影
问题描述
我有一个 Flutter 应用程序,我正在 iOS 上对其进行测试。我发现下图有阴影(和填充) - 下图。主要问题是左右填充。
有人知道如何摆脱它吗?
代码:
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
roundedImage("assets/images/avatar.png"),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("XXXXXX",
style: Theme.of(context)
.textTheme
.display2
.copyWith(fontSize: 20.0)),
Text("YYYYY",
style: Theme.of(context)
.textTheme
.display4
.copyWith(fontSize: 14.0)),
]),
Text("ZZZZZ",
style: Theme.of(context)
.textTheme
.display4
.copyWith(fontSize: 16.0, fontWeight: FontWeight.normal))
],
);
Widget roundedImage(String path) {
return Material(
shape: CircleBorder(),
color: Colors.transparent,
child: Image.asset('assets/images/xxx.png', width: imageSize, height:
imageSize)
);
解决方案
如果我没记错的话,你可以使用Row小部件的属性来做到这一点。使用mainAxisSize: MainAxisSize.min,从两侧删除填充。
Widget roundedImage(String path) {
return CircleAvatar(
backgroundImage: AssetImage("images/c1.jpeg"),
radius: 50.0,
);
}
推荐阅读
- javascript - JavaScript:多行选择
- python - Airflow API - DAG 运行的输出可通过 API 获得
- javascript - 在异步函数中推送到数组未过滤
- node.js - Lambda 函数直到最后才执行
- python - 比较两个字典并更新第一个字典中的值
- node.js - chai - 测试 api - 验证多个状态
- python - python3中大数除法不一致
- vb.net - 在 vb.net 中 FtpWebRequest 一段时间后出现 Crunch 问题
- javascript - FullCalendar:如何在不刷新页面的情况下添加/编辑事件
- php - 通过 cURL 向外部订单管理系统发送数据