1

UIScrollView上にあるUIViewの下に約900ピクセルのUIButtons/UISlidersがあります。scrollView と UIView フレームを 0,0,375,950 で alloc/init し、scrollView.contentSize を同じに設定し、userInteraction を有効にしました。それでも、画面のサイズより下のコントロール (675 y 以外) と対話することはできません。

self.viewInsideScrollView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 375, 950)];
self.viewInsideScrollView.userInteractionEnabled = YES;

self.scrollView.contentSize = CGSizeMake(self.viewInsideScrollView.frame.size.width, self.viewInsideScrollView.frame.size.height);
self.scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 375, 950)];
self.scrollView.delegate = self;
self.scrollView.scrollEnabled = YES;
self.scrollView.userInteractionEnabled = YES;
self.scrollView.scrollsToTop = YES;
self.scrollView.clipsToBounds = YES;
[self.scrollView addSubview:self.viewInsideScrollView];

ボタン、スライダー、collectionView はすべて追加され、Storyboards を介して scrollView の上にある UIView に制約されました。

4

0 に答える 0