美文网首页iOS相关技术实现
StoryBoard中UIScrollView设置content

StoryBoard中UIScrollView设置content

作者: 晴天mk1992 | 来源:发表于2018-04-09 06:19 被阅读0次

    今天开发在Storyboard页面中使用ScrollView,在 viewWillAppear 和 viewDidLoad 中设置了contentSize无效

    解决办法:在viewDidAppear设置contentSize

    override func viewDidAppear(_ animated: Bool) {
            scrollView.contentSize = CGSize.init(width: UIScreen.main.bounds.width, height: 800);
            scrollView.isScrollEnabled=true;
            scrollView.showsVerticalScrollIndicator = false;
        }
    

    相关文章

      网友评论

        本文标题:StoryBoard中UIScrollView设置content

        本文链接:https://www.haomeiwen.com/subject/svwrattx.html