AssistoLab / DropDown

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

RTL support #147

Open wajihkm opened 6 years ago

wajihkm commented 6 years ago

When I set the language to Arabic, The list appears at the same place as English even the main anchor view change its location. The correct behavior: 1

In Arabic: 2

omarhassansadek commented 6 years ago

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

eldesoky commented 6 years ago
if LanguageManager.shared.isRightToLeft {
    dropDown.layer.setAffineTransform(CGAffineTransform(scaleX: -1, y: 1))
    dropDown.customCellConfiguration = { (index: Index, item: String, cell: DropDownCell) -> Void in
        // Setup your custom UI components
        cell.optionLabel.layer.setAffineTransform(CGAffineTransform(scaleX: -1, y: 1))
    }
}
omarshamali commented 5 years ago

Swift 4.2 dropDown.customCellConfiguration = {(index, item, cell: DropDownCell) -> Void in cell.optionLabel.textAlignment = .center }

jithin-k commented 4 years ago

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