agiapp / BRPickerView

BRPickerView 封装的是iOS中常用的选择器组件,主要包括:日期选择器(支持年月日、年月等15种日期样式选择,支持设置星期、至今等)、地址选择器(支持省市区、省市、省三种地区选择)、自定义字符串选择器(支持单列、多列、二级联动、三级联动选择)。支持自定义主题样式,适配深色模式,支持将选择器组件添加到指定容器视图。
https://github.com/agiapp/BRPickerView
MIT License
2.57k stars 446 forks source link

iPhone X + XS + XR: cancel button landscape x position #93

Closed skuske closed 4 years ago

skuske commented 5 years ago

If the picker is presented in landscape view, the X position of the cancel button should pay attention to the safeAreaInsets on iPhone X, XS and XR devices, otherwise the cancel button is cut off on the left:

    UIEdgeInsets safeInsets = UIEdgeInsetsZero;
    safeInsets = ([UIApplication sharedApplication].delegate).window.safeAreaInsets;
    CGRect rectFrame=customStyle.cancelBtnFrame;
    rectFrame.origin.x+=safeInsets.left;
    customStyle.cancelBtnFrame=rectFrame;

Maybe that should be implemented by default ... :o)

agiapp commented 5 years ago

This problem has been solved. Please update to version 2.4.2. Thanks! :o)