简体   繁体   English

ScrollView.contentSize在IOS 7上不起作用

[英]ScrollView.contentSize doesn't work on IOS 7

My project is using ScrollView.contentSize . 我的项目正在使用ScrollView.contentSize

When I run it on Simulator (iOS 8) it works fine. 当我在Simulator(iOS 8)上运行它时,它可以正常工作。

But ScrollView.contentSize = CGSize() isn't working on iOS 7 on my own IPHONE 4. 但是ScrollView.contentSize = CGSize()在我自己的IPHONE 4上的iOS 7上不起作用。

It can be scrolled normally on IOS 8 (Simulator) but can't be scrolled on my IOS 7 (IPHONE 4). 它可以在IOS 8(模拟器)上正常滚动,但不能在我的IOS 7(IPHONE 4)上滚动。

This is my code: 这是我的代码:

self.scrollViewCovor.contentSize = CGSize(width: self.scrollViewCovor.frame.width, height: 596 + 281 + 80)

Anyone knows how to fix this? 有人知道如何解决这个问题吗?

Thanks! 谢谢!

UIScrollView scrolls on all the simulators but not on my iPhone UIScrollView在所有模拟器上滚动,但不在我的iPhone上滚动

you just need to resize the scrollview's frame size in viewDidLayoutSubviews 您只需要在viewDidLayoutSubviews中调整scrollview的框架大小

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM