【发布时间】:2014-03-14 11:22:17
【问题描述】:
我发现当我尝试滚动scrollivew 时,如果您拖动其中一个按钮,它会阻止scrollview 滚动。如果您正在拖动不包含任何内容的滚动视图的空白部分,它将滚动。有谁知道这个问题的解决方案吗?
我的 .h 文件只有一个滚动视图和顶部的图像:
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
@property (strong, nonatomic) IBOutlet UIImageView *bodyImage;
我的 .m 文件有这个来启用滚动
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[_scrollView setScrollEnabled:YES];
[_scrollView setContentSize:CGSizeMake(640, 1136)];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
然后我在图像顶部添加了一个按钮并将其推送到另一个视图控制器。
我明白为什么它只是单击按钮并转到下一个视图,因为按钮在顶部!我基本上只是希望用户能够滚动页面,当他/她实际点击时,它会转到下一个视图!
感谢大家的帮助,我真的很感激。
【问题讨论】:
标签: ios uiscrollview uibutton