iOS 8 popoverpresentationcontroller popoverlayoutmargin not working

前端 未结 2 1688
慢半拍i
慢半拍i 2021-01-30 23:14

I am using the new popOverPresentationController to present UIPopOverController in iOS 8. I set the popOverLayoutMargins with a value like

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-30 23:55

    It works on iOS 13 now.

    I guess the arrow point origin maybe follow this expressions

    let xRatio = (permittedArrowDirections is horizonal) ? 1/2 : 1
    let yRatio = (permittedArrowDirections is vertical) ? 1/2 : 1
    
    x =  sourceRect.origin.x + sourceRect.size.width * xRatio + popoverLayoutMargins.left
    y =  sourceRect.origin.y + sourceRect.size.height * yRatio + popoverLayoutMargins.top
    

提交回复
热议问题