【发布时间】:2013-12-18 10:28:39
【问题描述】:
是否可以让 UIScrollView 指示器在 iOS7 中一直显示?不仅在滚动时!
我已经搜索过,但找不到让它工作的方法。
我已经尝试了下面的代码,但它在 iOS7 上不起作用
#define noDisableVerticalScrollTag 836913
#define noDisableHorizontalScrollTag 836914
@implementation UIImageView (ForScrollView)
- (void) setAlpha:(float)alpha {
if (self.superview.tag == noDisableVerticalScrollTag) {
if (alpha == 0 && self.autoresizingMask == UIViewAutoresizingFlexibleLeftMargin) {
if (self.frame.size.width < 10 && self.frame.size.height > self.frame.size.width) {
UIScrollView *sc = (UIScrollView*)self.superview;
if (sc.frame.size.height < sc.contentSize.height) {
return;
}
}
}
}
if (self.superview.tag == noDisableHorizontalScrollTag) {
if (alpha == 0 && self.autoresizingMask == UIViewAutoresizingFlexibleTopMargin) {
if (self.frame.size.height < 10 && self.frame.size.height < self.frame.size.width) {
UIScrollView *sc = (UIScrollView*)self.superview;
if (sc.frame.size.width < sc.contentSize.width) {
return;
}
}
}
}
[super setAlpha:alpha];
}
@end
【问题讨论】:
-
您是否将滚动视图上的标签设置为 noDisableHorizontalScrollTag ?
-
实际上,我不确定该代码到底应该做什么,但据我所见,它除了 return 之外什么也没做:D
-
它看起来像是一个类别,覆盖了
UIImageView。无论如何,它真的很hacky。
标签: ios ipad uiscrollview