'静态'UIButton ontop UIScrollview?
我想要达到一个相当简单的效果。一个scrollView和它上面的静态按钮。
到目前为止还没问题。不幸的是,如果我想滚动视图“低谷”按钮,就会出现问题。因此,开始在按钮内拖动将影响按钮,而不是滚动视图。
关于如何实现这一点的任何想法?
非常感谢!
我认为这种方法不起作用,因为在UIScrollView中不推荐使用touchesBegan ...(这个信息是真的吗?)
不是解决方案:-)
@implementation MySuperButton
+ (id)buttonWithFrame:(CGRect)frame {
return [[[self alloc] initWithFrame:frame] autorelease];
}
- (id)initWithFrame:(CGRect)frame {
if (self == [super initWithFrame:frame]) {
NSLog(@"initWithFrame");
}
return self;
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[super touchesBegan:touches withEvent:event];
[self.nextResponder touchesBegan:touches withEvent:event];
NSLog(@"[self nextResponder]: %@", [self nextResponder]);
}
@end
不幸的是,这不起作用。我认为下一个响应者是我的UIView而不是我的UIScrollView。有任何想法吗?
如果我的viewcontroller是nextResponder,将触摸传递给scrollView,那么也没有任何反应。
没有找到相关结果
已邀请:
5 个回复
骚瓤
翱抹村
琶竞捆栓
时更新其框架。我从未尝试过这个,但它在理论上有效。
贡炮逗握惫
缔恃钨