hyperoslo / ImagePicker

:camera: Reinventing the way ImagePicker works.
Other
4.87k stars 677 forks source link

On iPhone X, camera flash and reverse camera icons in the upper corners are bordering the edge/cut off #375

Closed ulukaya closed 6 years ago

ulukaya commented 6 years ago

y4dfqhtzxcc

Peach82 commented 6 years ago

Had the same problem. To solve it in the ConstraintsSetup.swift file I changed line 120 from

for attribute in topViewAttributes {
     view.addConstraint(NSLayoutConstraint(item: topView, attribute: attribute,
        relatedBy: .equal, toItem: self.view, attribute: attribute,
        multiplier: 1, constant: 0))
    }

to

for attribute in topViewAttributes {
        if #available(iOS 11.0, *) {
            view.addConstraint(NSLayoutConstraint(item: topView, attribute: attribute,
                                                  relatedBy: .equal, toItem: self.view.safeAreaLayoutGuide, attribute: attribute,
                                                  multiplier: 1, constant: 0))
        } else {
            view.addConstraint(NSLayoutConstraint(item: topView, attribute: attribute,
                                                  relatedBy: .equal, toItem: self.view, attribute: attribute,
                                                  multiplier: 1, constant: 0))
        }
    }
ulukaya commented 6 years ago

Seems like this PR is targeting it. https://github.com/hyperoslo/ImagePicker/pull/372

arvidurs commented 6 years ago

The same with the bottom controls, they could be pushed up on the iPhoneX

annjawn commented 6 years ago

@onmyway133 PR #372 needs to be merged please.