how to add close button to modal view corner which is presented in UIModalPresentationPageSheet?

前端 未结 2 1738
野性不改
野性不改 2021-01-06 04:58

I want to add a floating close (x) button at the corner of an UIModalPresentationPageSheet View. The effect is like below:

2条回答
  •  粉色の甜心
    2021-01-06 05:45

    See if this works:

    myPresentedView.clipsToBounds = NO;

    That will allow the button to draw itself beyond it's views. One drawback to this is that the touches will not land beyond the views bounds, so try not to set the button too far away.

提交回复
热议问题