【问题标题】:Flutter Horizontal PageView with Child Width Larger Screen WidthFlutter Horizo​​ntal PageView with Child Width 更大的屏幕宽度
【发布时间】:2021-09-27 08:52:29
【问题描述】:

如何实现PageView width child有width更大的屏幕宽度。

PageView(
      controller: controller,
      children: const <Widget>[
       Image('img1.jpg'),
       Image('img2.jpg'),  // large image one
       Image('img3.jpg')
      ],
)

https://i.imgur.com/jvowQd2.mp4

【问题讨论】:

    标签: flutter flutter-pageview


    【解决方案1】:

    尝试使用InteractiveViewer。它使您可以在其中拥有更大尺寸的图像或小部件,并且用户可以从中放大或缩小。 InteractiveViewer 文档。

    【讨论】:

    • 感谢您的回复,但是子页面的宽度小于或等于屏幕宽度,我必须使用 InteractiveViewer 平移或缩放。
    • 您可以将其设置更改为原始大小。
    • 可以设置constraints = false
    猜你喜欢
    • 2020-06-19
    • 2019-06-28
    • 1970-01-01
    • 2020-01-21
    • 2011-02-27
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多