@@ -165,7 +165,11 @@ - (UIStatusBarStyle)preferredStatusBarStyle {
165165- (void )configCollectionView {
166166 _layout = [[UICollectionViewFlowLayout alloc ] init ];
167167 _collectionView = [[TZCollectionView alloc ] initWithFrame: CGRectZero collectionViewLayout: _layout];
168- _collectionView.backgroundColor = [UIColor whiteColor ];
168+ if (@available (iOS 13.0 , *)) {
169+ _collectionView.backgroundColor = UIColor.tertiarySystemBackgroundColor ;
170+ } else {
171+ _collectionView.backgroundColor = [UIColor whiteColor ];
172+ }
169173 _collectionView.dataSource = self;
170174 _collectionView.delegate = self;
171175 _collectionView.alwaysBounceHorizontal = NO ;
@@ -216,14 +220,22 @@ - (void)configBottomToolBar {
216220
217221 _bottomToolBar = [[UIView alloc ] initWithFrame: CGRectZero];
218222 CGFloat rgb = 253 / 255.0 ;
219- _bottomToolBar.backgroundColor = [UIColor colorWithRed: rgb green: rgb blue: rgb alpha: 1.0 ];
223+ if (@available (iOS 13.0 , *)) {
224+ _bottomToolBar.backgroundColor = UIColor.tertiarySystemBackgroundColor ;
225+ } else {
226+ _bottomToolBar.backgroundColor = [UIColor colorWithRed: rgb green: rgb blue: rgb alpha: 1.0 ];
227+ }
220228
221229 _previewButton = [UIButton buttonWithType: UIButtonTypeCustom];
222230 [_previewButton addTarget: self action: @selector (previewButtonClick ) forControlEvents: UIControlEventTouchUpInside];
223231 _previewButton.titleLabel .font = [UIFont systemFontOfSize: 16 ];
224232 [_previewButton setTitle: tzImagePickerVc.previewBtnTitleStr forState: UIControlStateNormal];
225233 [_previewButton setTitle: tzImagePickerVc.previewBtnTitleStr forState: UIControlStateDisabled];
226- [_previewButton setTitleColor: [UIColor blackColor ] forState: UIControlStateNormal];
234+ if (@available (iOS 13.0 , *)) {
235+ [_previewButton setTitleColor: UIColor.labelColor forState: UIControlStateNormal];
236+ } else {
237+ [_previewButton setTitleColor: [UIColor blackColor ] forState: UIControlStateNormal];
238+ }
227239 [_previewButton setTitleColor: [UIColor lightGrayColor ] forState: UIControlStateDisabled];
228240 _previewButton.enabled = tzImagePickerVc.selectedModels .count ;
229241
@@ -235,7 +247,11 @@ - (void)configBottomToolBar {
235247 [_originalPhotoButton setTitle: tzImagePickerVc.fullImageBtnTitleStr forState: UIControlStateNormal];
236248 [_originalPhotoButton setTitle: tzImagePickerVc.fullImageBtnTitleStr forState: UIControlStateSelected];
237249 [_originalPhotoButton setTitleColor: [UIColor lightGrayColor ] forState: UIControlStateNormal];
238- [_originalPhotoButton setTitleColor: [UIColor blackColor ] forState: UIControlStateSelected];
250+ if (@available (iOS 13.0 , *)) {
251+ [_originalPhotoButton setTitleColor: [UIColor labelColor ] forState: UIControlStateSelected];
252+ } else {
253+ [_originalPhotoButton setTitleColor: [UIColor blackColor ] forState: UIControlStateSelected];
254+ }
239255 [_originalPhotoButton setImage: tzImagePickerVc.photoOriginDefImage forState: UIControlStateNormal];
240256 [_originalPhotoButton setImage: tzImagePickerVc.photoOriginSelImage forState: UIControlStateSelected];
241257 _originalPhotoButton.imageView .clipsToBounds = YES ;
@@ -246,7 +262,11 @@ - (void)configBottomToolBar {
246262 _originalPhotoLabel = [[UILabel alloc ] init ];
247263 _originalPhotoLabel.textAlignment = NSTextAlignmentLeft;
248264 _originalPhotoLabel.font = [UIFont systemFontOfSize: 16 ];
249- _originalPhotoLabel.textColor = [UIColor blackColor ];
265+ if (@available (iOS 13.0 , *)) {
266+ _originalPhotoLabel.textColor = [UIColor labelColor ];
267+ } else {
268+ _originalPhotoLabel.textColor = [UIColor blackColor ];
269+ }
250270 if (_isSelectOriginalPhoto) [self getSelectedPhotoBytes ];
251271 }
252272
@@ -276,7 +296,20 @@ - (void)configBottomToolBar {
276296
277297 _divideLine = [[UIView alloc ] init ];
278298 CGFloat rgb2 = 222 / 255.0 ;
279- _divideLine.backgroundColor = [UIColor colorWithRed: rgb2 green: rgb2 blue: rgb2 alpha: 1.0 ];
299+ if (@available (iOS 13.0 , *)) {
300+ UIColor *divideLineDyColor = [UIColor colorWithDynamicProvider: ^UIColor * _Nonnull (UITraitCollection * _Nonnull trainCollection) {
301+ if ([trainCollection userInterfaceStyle ] == UIUserInterfaceStyleLight) {
302+ return [UIColor colorWithRed: rgb2 green: rgb2 blue: rgb2 alpha: 1.0 ];
303+ }
304+ else {
305+ CGFloat lineDarkRgb = 100 / 255.0 ;
306+ return [UIColor colorWithRed: lineDarkRgb green: lineDarkRgb blue: lineDarkRgb alpha: 1.0 ];
307+ }
308+ }];
309+ _divideLine.backgroundColor = divideLineDyColor;
310+ } else {
311+ _divideLine.backgroundColor = [UIColor colorWithRed: rgb2 green: rgb2 blue: rgb2 alpha: 1.0 ];
312+ }
280313
281314 [_bottomToolBar addSubview: _divideLine];
282315 [_bottomToolBar addSubview: _previewButton];
0 commit comments