1

I have a horizontal scrollView with a lot of buttons inside but none of them responding. The scrollview works well.

Here is how my scrollview is declared, pretty standard :

_slotsScrollView = [UIScrollView new];
_slotsScrollView.pagingEnabled = YES;
_slotsScrollView.showsHorizontalScrollIndicator = NO;
_slotsScrollView.showsVerticalScrollIndicator = NO;
_slotsScrollView.delaysContentTouches = NO;
_slotsScrollView.canCancelContentTouches = YES;

The scrollview contains one main view which contains all the buttons, the structure is this one :

--UIScrollView
----UIView
  ----UIButton
  ----UIButton
  ----UIButton ...

I've already try a lot of tricks (see here or here) but none of them have solved my problem, any idea ?

Community
  • 1
  • 1
R.Lambert
  • 1,160
  • 1
  • 11
  • 25
  • 1
    Is the container view big enough to contain all of the buttons? e.g. do all of the buttons fall within the bounds of the containerView? – Paul.s Oct 19 '14 at 22:51
  • Oh god, i'm so stupid, i've spend two hours because i just forgot to set the height of my container view. Thank you Paul, problem solved. – R.Lambert Oct 19 '14 at 23:29

1 Answers1

1

You need to make sure that the frames of all the buttons fall within the containerView's bounds.

Paul.s
  • 38,494
  • 5
  • 70
  • 88