UIButton does not work when it in UIScrollView

后端 未结 8 488
说谎
说谎 2020-12-01 10:38

My structure of views:

UITableView
  UITableViewCell
    UIScrollView
      CustomView
        UIButton

The problem is UIButton doesn\'t wo

8条回答
  •  旧巷少年郎
    2020-12-01 11:37

    None of the answers worked for me, because my problem was that the button was not visible at layout time or something...

    FIX:

    1) move the button out of the scrollView completely (to be subview of VC's main view).

    2) select the button and the element from your contentV you want your button located (in my case: after the last element in conventV)

    3) add the necessary constraints (in my case: to be bottom aligned)

    4) Add the rest of the constraints for the button.

    5) Enjoy.

提交回复
热议问题