iOS - UIButton on UIPageControl not working

后端 未结 1 988
暗喜
暗喜 2021-01-27 22:59

I am using UIPageControl as indicator between different page (view controllers) of my application. In each of the view controllers, I need to have a different butto

1条回答
  •  别那么骄傲
    2021-01-27 23:08

    I guess the page control and the view controller view are both subviews of the same view. In this case, the button is drawn outside of the view controllers view bounds. This is allowed by default, but it does have the side effect that the button can't be tapped on as the superview doesn't handle the touch.

    You should have the buttons on the page control owned by the 'super' view controller (the controller that owns the root view containing the page control and the child view controllers). Then, when a button is tapped it should tell the child view controller about it so that it can take the appropriate action.

    0 讨论(0)
提交回复
热议问题