Why does an empty UIScrollView have two subheadings?

I need to calculate the height of my content in a UIScrollView.

I dropped the empty UIScrollView in the Xcode Storyboard, gave it a special class with this code:

- (id)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (self) { int i; for (i = 0; i < [self.subviews count]; i++) { UIView *view =[self.subviews objectAtIndex:i]; NSLog(@"sub view %@ x:%f, y:%f, w:%f, h:%f", [view class], view.frame.origin.x, view.frame.origin.y, view.frame.size.width, view.frame.size.height); } } return self; } 

With an empty UIScrollView, this is what goes into the console:

 sub view UIImageView x:233.000000, y:121.000000, w:7.000000, h:7.000000 sub view UIImageView x:233.000000, y:121.000000, w:7.000000, h:7.000000 

What kind of images are these? They discard my calculations because they are always below my content.

+4
source share
1 answer

These are scrollbars (or scrollbars, if you like). One is horizontal and the other is vertical.

+7
source

All Articles