簡體   English   中英

Flutter InteractiveViewer 不平移/滾動

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM