简体   繁体   English

无法在我的iOS应用程序中滚动

[英]Can't scroll in my iOS application

I'm pretty new in creating iOS applications and currently I'm following Apple's starter tutorial. 我在创建iOS应用程序方面还很陌生,目前正在关注Apple的入门教程。

到目前为止的申请

They suggest simulating on iPhone 6 which has a pretty big screen and therefore all the content fit its screen, however I'm simulating on iPhone 4 which has a smaller screen. 他们建议在屏幕较大的iPhone 6上模拟,因此所有内容都适合其屏幕,但是我在屏幕较小的iPhone 4上进行模拟。 All the content don't fit and I can't see all of the placeholder image. 所有内容都不适合,我看不到所有占位符图像。 I'd expect that I would automatically be able to scroll so I'm able to view all the content but no. 我希望我能够自动滚动,以便能够查看所有内容,但不能。

iPhone 4模拟器

It seems that you have designed your contents on normal view. 您似乎已经在普通视图上设计了内容。 Instead you have to use UIScrollView which will allow you to scroll to see all your contents. 相反,您必须使用UIScrollView ,它将允许您滚动查看所有内容。 contentSize property is important for this. contentSize属性对此很重要。

Refer Here: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScrollView_Class/ 请参阅此处: https : //developer.apple.com/library/ios/documentation/UIKit/Reference/UIScrollView_Class/

The UIScrollView class provides support for displaying content that is larger than the size of the application's window. UIScrollView类支持显示大于应用程序窗口大小的内容。 It enables users to scroll within that content by making swiping gestures, and to zoom in and back from portions of the content by making pinching gestures. 它使用户可以通过滑动手势在该内容中滚动,并通过捏捏手势来放大和缩小内容的一部分。

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

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