[英]Unable to Center InteractiveViewer and panning in Flutter Web app
[英]Flutter InteractiveViewer not panning/scrolling
InteractiveViewer(
child: FlutterLogo(size: 1000),
)
FlutterLogo
比視口大,因此我將它包裹在InteractiveViewer
但它沒有平移。 我檢查了panEnabled
,默認情況下它是true
。 我錯過了什么?
如果您的小部件大於視口,則需要將constrained
設置為false
。
受約束:如果設置為 false,則子項將被賦予無限約束。 當孩子應該比 InteractiveViewer 大時,這通常很有用。
InteractiveViewer(
constrained: false, // Set it to false
child: FlutterLogo(size: 1000),
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.