修改UI
This commit is contained in:
20
Pods/JXCategoryView/Sources/RLTManager/RTLManager.h
generated
Normal file
20
Pods/JXCategoryView/Sources/RLTManager/RTLManager.h
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// RTLManager.h
|
||||
// JXCategoryView
|
||||
//
|
||||
// Created by jiaxin on 2020/7/3.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RTLManager : NSObject
|
||||
|
||||
+ (BOOL)supportRTL;
|
||||
+ (void)horizontalFlipView:(UIView *)view;
|
||||
+ (void)horizontalFlipViewIfNeeded:(UIView *)view;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
26
Pods/JXCategoryView/Sources/RLTManager/RTLManager.m
generated
Normal file
26
Pods/JXCategoryView/Sources/RLTManager/RTLManager.m
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// RTLManager.m
|
||||
// JXCategoryView
|
||||
//
|
||||
// Created by jiaxin on 2020/7/3.
|
||||
//
|
||||
|
||||
#import "RTLManager.h"
|
||||
|
||||
@implementation RTLManager
|
||||
|
||||
+ (BOOL)supportRTL {
|
||||
return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:UIView.appearance.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft;
|
||||
}
|
||||
|
||||
+ (void)horizontalFlipView:(UIView *)view {
|
||||
view.transform = CGAffineTransformMakeScale(-1, 1);
|
||||
}
|
||||
|
||||
+ (void)horizontalFlipViewIfNeeded:(UIView *)view {
|
||||
if ([self supportRTL]) {
|
||||
[self horizontalFlipView:view];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user