Flip UIImageViews for Right to Left Languages

后端 未结 7 1490
悲&欢浪女
悲&欢浪女 2021-02-13 02:31

iOS automatically flips the entire ViewController when using a RTL language like Arabic and does a great job with most of the layout, especially text. The default b

相关标签:
7条回答
  • 2021-02-13 03:18

    You have to manually flip the UIImages in the UIImageViews you want when the phone is set to a RTL language. This can be easily achieved with this code:

    UIImage* defaultImage = [UIImage imageNamed:@"default.png"];
    UIImage* flipImage = [UIImage imageWithCGImage:sourceImage.CGImage scale:1.0 orientation: UIImageOrientationUpMirrored];
    myImageview.image = flipImage;
    
    0 讨论(0)
提交回复
热议问题