I am doing universal app with size classes. It looks pretty well on iPhones from 5 to 6 Plus. But I need a scroll for 4S. So I added a scroll view, I did it like advice here. But my scroll doesn't fix on iPhones 5-6Plus. It's scrolling a little bit. But I want it available on 4S only. I am doing with it more than one day, I've tried different kind of constraints but nothing helps. Could you give me some advice, please.
Asked
Active
Viewed 187 times
1 Answers
0
You could set the contentSize-property of your scrollview to the height/width of the scrollView itself when on an iPhone 5/6/.. .
// determine which device (here just schematically) ...
switch (device)
{
case "iPhone 4S":
// ...
default: // means that the user has an iPhone 5 / 6 / ... / iPad / ...
scrollView.contentSize = CGSize(width: scrollView.frame.width, height: scrollView.frame.height)
scrollView.bounces = false
// make sure that the scrollView does not show vertical/horizontal scroll indicators ...
}
Then the size of the scrollView and the Size of its contentSize are equal, so you should not be able to scroll in it. To determine your device type, use e.g. Determine device (iPhone, iPod Touch) with iPhone SDK

Community
- 1
- 1

Florian Pfisterer
- 1,205
- 12
- 21