我使用故事板实现了左侧swrevealviewcontroller,但由于阿拉伯语本地化,侧面菜单中的所有标签和图标都正确,但侧面菜单本身保留在左侧。有没有机会我可以通过编程方式告诉revealviewcontroller是从右边还是左边打开?
我尝试了这一行,但它不起作用:
[self.sidebarButton setAction: @selector( rightRevealToggle: )];
答案 0 :(得分:0)
let revealController = self.storyboard?.instantiateViewController(withIdentifier: "SWRevealViewControllerSBID") as? SWRevealViewController
let rearController = self.storyboard?.instantiateViewController(withIdentifier: "SideMenuVCSBID")
let frontViewController = self.storyboard?.instantiateViewController(withIdentifier: "HomeVCSBID")
let navigationController = UINavigationController.init(rootViewController: frontViewController!)
revealController?.setFront(navigationController, animated: true)
if AppController.sharedInstance.language == "en" {
revealController?.setRight(rearController, animated: true)
} else {
revealController?.setRear(rearController, animated: true)
}
self.present(revealController!, animated: true, completion: nil)