Flutter 如何实现;instagram照相机“;在颤振中滚动?
我试图在页面视图中使用滚动视图在颤振中实现此效果: 但是当我滚动到第二页时,我被卡住了,再也回不去了 示例代码:Flutter 如何实现;instagram照相机“;在颤振中滚动?,flutter,flutter-layout,Flutter,Flutter Layout,我试图在页面视图中使用滚动视图在颤振中实现此效果: 但是当我滚动到第二页时,我被卡住了,再也回不去了 示例代码: import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) {
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: Text("Demo"),
),
body: PageView(
scrollDirection: Axis.vertical,
children:[
Container(color: Colors.red),
ListView(
children:[
Container(color: Colors.yellow, height:300),
Container(color: Colors.green, height:300),
]
)
],
),
),
);
}
}
当ScrollView结束时,如何将onDrag事件发送到PageView?listview将无法与pageviewer一起使用,因此请使用wrap小部件而不是listview,如下所示
PageView(
scrollDirection: Axis.vertical,
children:[
Container(color: Colors.red),
Wrap(
children:[
Container(color: Colors.yellow, height:300),
Container(color: Colors.green, height:300),
]
)
],
),
但是现在如果我有多个容器在包装中,我不能滚动它们