两个图像视图获取添加到使用对象库添加的scrollView?
问题描述:
在我的应用程序中,我使用ScrollView来显示数据列表(通过为列表中的每个条目添加每个视图),当新条目添加到数据列表中时,我将一个新视图添加为scrollView的子视图,我使用subViews计数来定位新添加的视图,在那里我遇到了一个问题,我的scrollView有两个imageViews。两个图像视图获取添加到使用对象库添加的scrollView?
我检查的-viewDidLoad
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"subvs %@",[sampleScroll subviews]);
}
这里是我的控制台窗口
subvs (
"<UIImageView: 0x72b9610; frame = (233 121; 7 7); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; animations = { contentsCenter=<CABasicAnimation: 0x72dd8b0>; position=<CABasicAnimation: 0x72e2520>; }; layer = <CALayer: 0x72b96b0>>",
"<UIImageView: 0x72e2ae0; frame = (233 121; 7 7); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; animations = { contentsCenter=<CABasicAnimation: 0x72b7c50>; position=<CABasicAnimation: 0x72b7ce0>; }; layer = <CALayer: 0x72e2b80>>"
)
编辑:-I've加入了滚动通过拖放在厦门国际银行
答
那些是水平和垂直滚动指标(默认为UIImageviews),它们用滚动视图初始化
如果你不想要那么你可以像这样删除它们
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"subvs %@",[sampleScroll subviews]);
for(UIView *view in sampleScroll.subviews){
[view removeFromSuperview];
}
}
你在哪里添加?什么是对象libray? – Buntylm
@BuntyMadan i'am将它添加到xib –
意味着当发现新条目时,您需要在'UIScrollView'上添加新的视图? – Buntylm