UICollectionView:自定义继承UICollectionViewFlowLayout子类,重写var flipsHorizontallyInOppositeLayoutDirection: Bool
override var flipsHorizontallyInOppositeLayoutDirection: Bool {
get{
return true //true:RTL, false:LTR
}
}
UIScrollView: 使用transform.scaledBy()水平翻转模拟镜像,然后scrollView的子视图scrollSubView再调用transform.scaledBy()将镜像设置回来
scrollView.transform = CGAffineTransform.identify.scaledBy(x: -1.0, y: 1.0)
scrollSubView.transform = CGAffineTransform.identify.scaledBy(x: -1.0, y: 1.0)