记录UIScrollView的子视图会显示未添加的子视图

时间:2014-04-29 11:54:09

标签: ios cocoa-touch uiview uiscrollview

当我通过这样做记录UIScrollView的子视图时,

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

这是控制台中记录的内容:

(
    "<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}>"
)

我在滚动视图中添加了两个UITextViewUIImageView来自哪里?我还没有在滚动视图中放置图像视图。

1 个答案:

答案 0 :(得分:2)

这是滚动视图的滚动指示器。注意它很窄但很高(5×40)。这是滚动视图的私有子视图;你应该不管它。