AssistoLab / DropDown

A Material Design drop down for iOS
MIT License
2.44k stars 626 forks source link

Not supporting rtl #79

Open vp-Petkov opened 7 years ago

vp-Petkov commented 7 years ago

if you change the semantic of the layout of your app to RTL the positioning of the drop down on the x axis is not respecting it.

nareshbhadresha commented 7 years ago

same here... Did you discover any workaround?

mhdabdulhameed commented 7 years ago

Workaround: I fixed the issue by applying an affine transform on the drop down menu, and applying another affine transform on the child views of the child views of the menu:

if Utility.isRTL() {

    // Flip the drop down menu (To make it appear on the other side)
    self.mainDropDownMenu.layer.setAffineTransform(CGAffineTransform(scaleX: -1, y: 1))

    // Flip the subviews of the subviews
    for view in self.mainDropDownMenu.subviews {

        for view in view.subviews {
            view.layer.setAffineTransform(CGAffineTransform(scaleX: -1, y: 1))
        }
    }
}

Utility.isRTL() is a method that decides whether the application is running in RTL mode or not.

I know this is not the best way to do it!

omarhassansadek commented 6 years ago

or use dropdown.semanticContentAttribute=UIApplication.isRTL() ? .forceLeftToRight : .forceLeftToRight

jithin-k commented 4 years ago

https://github.com/AssistoLab/DropDown/issues/238#issuecomment-512797400