UIScrollView中的奇怪UIImageView [英] Strange UIImageView in UIScrollView
本文介绍了UIScrollView中的奇怪UIImageView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
非常奇怪的行为,使用此代码在屏幕中央有一个圆点,并且在笔尖内部没有任何内容的UIScrollview。我希望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);
}
控制台输出为:
<UIImageView: 0x4b1f780; frame = (380.5 508.5; 7 7); opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x4b1f820>
有谁知道为什么?
推荐答案
放大UIImageView并调整配置后,我得出结论,UIImageView实际上是滚动条,如果启用水平和垂直滚动,空UIScrollview里面有两个子视图。
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.
这篇关于UIScrollView中的奇怪UIImageView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文