Question

When I log a UIScrollView's subviews by doing this,

NSLog(@"%@", self.scrollView.subviews);

this is what is logged in the console:

(
    "<UITextView: 0x936ec00; frame = (35 6; 561 40); text = 'Bvnxbmn'; clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x8b4fbe0>; layer = <CALayer: 0x8b4d5c0>; contentOffset: {0, 0}>",
    "<UIImageView: 0x8b70980; frame = (625 267; 5 40); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x8b725a0>>",
    "<UITextView: 0xab30000; frame = (34 50; 561 40); text = ''; clipsToBounds = YES; gestureRecognizers = <NSArray: 0x9a5d6a0>; layer = <CALayer: 0x9a54f90>; contentOffset: {0, 0}>"
)

I've added two UITextViews in the scroll view. Where did the UIImageView come from? I haven't put an image view in the scroll view.

Was it helpful?

Solution

It is the scroll view’s scroll indicator. Notice it is very narrow but tall (5 × 40). This is a private subview of the scroll view; you should leave it alone.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top