用户登录
用户注册

分享至

UIScrollView 在从不同的视图控制器 segu 时具有不同的 y 位置

  • 作者: 萌萌哒c
  • 来源: 51数据库
  • 2022-10-25

问题描述

不知道如何解释这一点,只是当从一个控制器进行 segue 时,滚动视图在屏幕上低于另一个正确的 segue.

Not sure how to explain this, simply when seguing from one controller the scroll view is lower on the screen than from another segue where it is correct.

推荐答案

设置这2个scrollview属性并勾选.

Set this 2 scrollview property and check it.

self.scrollView.contentOffset = CGPointZero;
self.scrollView.contentInset = UIEdgeInsetsZero;

检查这个答案它可能会帮助你UIScrollView 在 contentSize 变化时调整 contentOffset

Check this answer it may help you UIScrollView adjusts contentOffset when contentSize changes

软件
前端设计
程序设计
Java相关