iOSDropDown icon indicating copy to clipboard operation
iOSDropDown copied to clipboard

Option list layout not correct after rotation

Open tbechtum opened this issue 5 years ago • 2 comments

Hi,

when the option list is displayed and then rotating the device you face that option list is not positioned correctly below the DropDown text field.

Simulator Screen Shot - iPhone Xs - 2019-08-07 at 16 39 46

Any idea how to fix this? What shall I call on UIViewController's willTransition callback?

Thanks for your help, cheers, Thomas

tbechtum avatar Aug 07 '19 14:08 tbechtum

I also got this issue, have you found any solution?

lexcellence avatar Dec 27 '19 05:12 lexcellence

I just solved it, please comment pointToParent = getConvertedPoint(self, baseView: parentController?.view), and then move it outside the if(). please check the following sample code and you can solve the issue. It means every showList would get the latest point from parent view.

public func showList() {
    if parentController == nil{
        parentController = self.parentViewController
        backgroundView.frame = parentController?.view.frame ?? backgroundView.frame
        //pointToParent = getConvertedPoint(self, baseView: parentController?.view)
    }
    pointToParent = getConvertedPoint(self, baseView: parentController?.view)
    parentController?.view.insertSubview(backgroundView, aboveSubview: self)

lexcellence avatar Dec 27 '19 07:12 lexcellence