From 1ff2daa0ef0ae559ba98feb79e37dc17b7cbf2e8 Mon Sep 17 00:00:00 2001 From: Yauxryo Date: Sat, 3 Jun 2023 17:23:08 +0700 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E6=BB=9A=E5=8A=A8=E6=96=B9?= =?UTF-8?q?=E5=90=91=E9=80=82=E9=85=8D=E9=98=BF=E6=8B=89=E4=BC=AF=E8=AF=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TYCyclePagerViewDemo/TYCyclePagerView/TYCyclePagerView.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/TYCyclePagerViewDemo/TYCyclePagerView/TYCyclePagerView.m b/TYCyclePagerViewDemo/TYCyclePagerView/TYCyclePagerView.m index a2f42d5..3055159 100755 --- a/TYCyclePagerViewDemo/TYCyclePagerView/TYCyclePagerView.m +++ b/TYCyclePagerViewDemo/TYCyclePagerView/TYCyclePagerView.m @@ -142,7 +142,11 @@ - (void)timerFired:(NSTimer *)timer { return; } - [self scrollToNearlyIndexAtDirection:TYPagerScrollDirectionRight animate:YES]; + BOOL isRTL = NO; + if (@available(iOS 9.0, *)) { + isRTL = UIView.appearance.semanticContentAttribute == UISemanticContentAttributeForceRightToLeft; + } + [self scrollToNearlyIndexAtDirection:(isRTL ? TYPagerScrollDirectionLeft : TYPagerScrollDirectionRight) animate:YES]; } #pragma mark - getter