2

In the designer I added a Scrollview, I made it have a scrollbar with this code:

svDetails.contentSize = CGSizeMake(360, 400);

However I want it to be 100% of the phone width. (leave the width unchanged).

Because right now it fits perfectly on iPhone 4s,5 and 5s but doesn't look quite right on the iPhone 6,6+ (scrollview is to small)

AmanicA
  • 4,659
  • 1
  • 34
  • 49
Kaaseter
  • 359
  • 1
  • 5
  • 6

2 Answers2

2

You can use this code:

svDetails.contentSize = CGSizeMake(self.view.frame.size.width, self.view.frame.size.height)

Hope it helps.

Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165
0

Dharmesh Kheni' solution from above in

Swift 3:

svDetails.contentSize = CGSize(width: self.view.frame.size.width, height: self.view.frame.size.height)
Tobi
  • 161
  • 1
  • 7