flutter - 隐藏溢出颤动,没有溢出消息
问题描述
我有一个想要部分可见的动画。
基本上屏幕的结尾应该将动画切成两半。所以动画是溢出的,但这是有意的。那么如何删除溢出的消息?
return ClipRect(
child: Container(
width: MediaQuery.of(context).size.width - 32,
child: Padding(
padding: const EdgeInsets.fromLTRB(spacingM, spacingM, 0, spacingM),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
TextInfo(
location: location, dateFormatter: dateFormatter, date: date),
Transform.translate(
offset: Offset(30, 0),
child: WeatherAnimation(),
),
],
),
),
),
);
解决方案
尝试使用FittedBox包装溢出的内容。这将剪掉溢出的内容。
在这种情况下,我相信您应该包装Padding
小部件,或者可能是Row
小部件,FittedBox
以允许FittedBox
其形成其父级并剪辑子级以适应。
推荐阅读
- react-native - react-native-elements 叠加边框透明度
- reactjs - Reactjs 在变量准备好之前不会渲染
- jquery - 如何读取 HTML 元素的 data-original-title 的值
- google-sheets - 如果在某个日期之前,将返回查询中的日期替换为文本
- typescript - TypeScript - 输入“数字”| undefined' 不可分配给类型 'number'
- arrays - 如何根据 jsonb 列值对数据进行排序
- javascript - Vue.js 在组件中使用本地 javascript 文件函数:Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_0__.writeSomething is not a function
- javascript - 在外部播放器中打开媒体文件
- bixby - 如何更改“搜索某事”文本?
- php - 如何使用数据表中选定项目的 id 作为按钮?