UIScrollView 从右向左反向模式 适配阿拉伯语系
2022-04-12 本文已影响0人
路漫漫其修远兮Wzt
问题:针对UIScrollView,我们需要怎么修改,使它以反向模式滚动,来适配阿拉伯语系。
方案:可以通过对scrollView、以及其上的子视图,分别作180变换实现:
self.scrollView.transform = CGAffineTransformMakeRotation(M_PI);
subView.transform = CGAffineTransformMakeRotation(M_PI);
参考:
UIScrollView Direction RTL for Right to Left Languages
Can we change the behavior of UIScrollView that it scrolls RTL content in it's reverse mode?
You can achieve it by rotating UIScrollView in Child views by 180 (Pi).
self.scrollView.transform = CGAffineTransformMakeRotation(M_PI);
subView.transform = CGAffineTransformMakeRotation(M_PI);