Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strange UIImageView in UIScrollView

Very strange behavior, there is a round dot in the center of the screen using this code, and a UIScrollview with nothing inside in a nib. I expect that UIScrollview should be empty. The dot blurs and disappears when I scroll the screen.

- (void)viewDidLoad {
    [super viewDidLoad];
    NSArray *subviews = [closetScroll subviews];
    UIImageView *strange=[subviews objectAtIndex:0];
    strange.center = CGPointMake([[UIScreen mainScreen] bounds].size.width/2, [[UIScreen mainScreen] bounds].size.height/2);
    strange.alpha=1;

    NSLog(@"%@",subviews);
}

The console output is:

<UIImageView: 0x4b1f780; frame = (380.5 508.5; 7 7); opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x4b1f820>

Does anyone know why?

like image 597
TiansHUo Avatar asked Mar 22 '11 08:03

TiansHUo


1 Answers

After magnifying the UIImageView and tweaking with configurations, I have come to conclude that the UIImageView is actually the scroll bar, and if horizontal and vertical scroll is enabled, an "empty" UIScrollview has two subviews inside.

like image 71
TiansHUo Avatar answered Sep 27 '22 17:09

TiansHUo