hyzp_ybqx-Commit166:解决在审核页面hysh_content_new.dart,当图片组件缩放后,点击文本输入框软键盘弹起遮挡文本输入框组件的问题

// 若 scrollPhysics0 赋值为 PageScrollPhysics(),图片组件缩放后,点击文本输入框软键盘弹起会遮挡文本输入框组件
  // 将 scrollPhysics0 赋值为 AlwaysScrollableScrollPhysics(),问题解决
  ScrollPhysics scrollPhysics0 = AlwaysScrollableScrollPhysics();
master
WinUser01 4 years ago
parent a975cef186
commit 8150e6e517

@ -596,6 +596,11 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
// 使 my_flutter_drag_scale Listview // 使 my_flutter_drag_scale Listview
ScrollPhysics scrollPhysics; ScrollPhysics scrollPhysics;
// scrollPhysics0 PageScrollPhysics()
// scrollPhysics0 AlwaysScrollableScrollPhysics()
ScrollPhysics scrollPhysics0 = AlwaysScrollableScrollPhysics();
bool bZoomedInit = true; // bool bZoomedInit = true; //
Widget getNetworkImage(String url) { Widget getNetworkImage(String url) {
return CachedNetworkImage( return CachedNetworkImage(
@ -611,13 +616,13 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
scaleChangedCallback: (ScaleChangedModel model) { scaleChangedCallback: (ScaleChangedModel model) {
print("model.scale = ${model.scale}"); print("model.scale = ${model.scale}");
bZoomedInit = (1.0 == model.scale); bZoomedInit = (1.0 == model.scale);
scrollPhysics = PageScrollPhysics(); scrollPhysics = scrollPhysics0;
setState(() {}); setState(() {});
}, },
pointerDownCallback: () { pointerDownCallback: () {
if (bZoomedInit) { if (bZoomedInit) {
if (scrollPhysics != PageScrollPhysics()) { if (scrollPhysics != PageScrollPhysics()) {
scrollPhysics = PageScrollPhysics(); scrollPhysics = scrollPhysics0;
setState(() {}); setState(() {});
} }
} else { } else {
@ -628,7 +633,7 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
} }
}, },
pointerUpCallback: () { pointerUpCallback: () {
scrollPhysics = PageScrollPhysics(); scrollPhysics = scrollPhysics0;
setState(() {}); setState(() {});
}, },
); );
@ -924,7 +929,11 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
), ),
//: Container(), //: Container(),
//type 'Container' is not a subtype of type 'PreferredSizeWidget' //type 'Container' is not a subtype of type 'PreferredSizeWidget'
body: listGetZpjl.isNotEmpty body: GestureDetector(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
},
child: listGetZpjl.isNotEmpty
? TabBarView( ? TabBarView(
controller: _tabController, controller: _tabController,
//TabControllertab //TabControllertab
@ -990,6 +999,7 @@ class _HyshPageState extends State<HyshContentNew> with SingleTickerProviderStat
: getMoreWidget(color: Colors.black38, size: 20.0, strokeWidth: 2.0), // : getMoreWidget(color: Colors.black38, size: 20.0, strokeWidth: 2.0), //
), ),
), ),
),
); );
} }

Loading…
Cancel
Save