@@ -166,7 +166,11 @@ - (void)configCollectionView {
166
166
if (!_collectionView) {
167
167
_layout = [[UICollectionViewFlowLayout alloc ] init ];
168
168
_collectionView = [[TZCollectionView alloc ] initWithFrame: CGRectZero collectionViewLayout: _layout];
169
- _collectionView.backgroundColor = [UIColor whiteColor ];
169
+ if (@available (iOS 13.0 , *)) {
170
+ _collectionView.backgroundColor = UIColor.tertiarySystemBackgroundColor ;
171
+ } else {
172
+ _collectionView.backgroundColor = [UIColor whiteColor ];
173
+ }
170
174
_collectionView.dataSource = self;
171
175
_collectionView.delegate = self;
172
176
_collectionView.alwaysBounceHorizontal = NO ;
@@ -177,6 +181,7 @@ - (void)configCollectionView {
177
181
} else {
178
182
[_collectionView reloadData ];
179
183
}
184
+
180
185
181
186
if (_showTakePhotoBtn) {
182
187
_collectionView.contentSize = CGSizeMake (self.view .tz_width , ((_model.count + self.columnNumber ) / self.columnNumber ) * self.view .tz_width );
@@ -224,14 +229,22 @@ - (void)configBottomToolBar {
224
229
225
230
_bottomToolBar = [[UIView alloc ] initWithFrame: CGRectZero];
226
231
CGFloat rgb = 253 / 255.0 ;
227
- _bottomToolBar.backgroundColor = [UIColor colorWithRed: rgb green: rgb blue: rgb alpha: 1.0 ];
232
+ if (@available (iOS 13.0 , *)) {
233
+ _bottomToolBar.backgroundColor = UIColor.tertiarySystemBackgroundColor ;
234
+ } else {
235
+ _bottomToolBar.backgroundColor = [UIColor colorWithRed: rgb green: rgb blue: rgb alpha: 1.0 ];
236
+ }
228
237
229
238
_previewButton = [UIButton buttonWithType: UIButtonTypeCustom];
230
239
[_previewButton addTarget: self action: @selector (previewButtonClick ) forControlEvents: UIControlEventTouchUpInside];
231
240
_previewButton.titleLabel .font = [UIFont systemFontOfSize: 16 ];
232
241
[_previewButton setTitle: tzImagePickerVc.previewBtnTitleStr forState: UIControlStateNormal];
233
242
[_previewButton setTitle: tzImagePickerVc.previewBtnTitleStr forState: UIControlStateDisabled];
234
- [_previewButton setTitleColor: [UIColor blackColor ] forState: UIControlStateNormal];
243
+ if (@available (iOS 13.0 , *)) {
244
+ [_previewButton setTitleColor: UIColor.labelColor forState: UIControlStateNormal];
245
+ } else {
246
+ [_previewButton setTitleColor: [UIColor blackColor ] forState: UIControlStateNormal];
247
+ }
235
248
[_previewButton setTitleColor: [UIColor lightGrayColor ] forState: UIControlStateDisabled];
236
249
_previewButton.enabled = tzImagePickerVc.selectedModels .count ;
237
250
@@ -243,7 +256,11 @@ - (void)configBottomToolBar {
243
256
[_originalPhotoButton setTitle: tzImagePickerVc.fullImageBtnTitleStr forState: UIControlStateNormal];
244
257
[_originalPhotoButton setTitle: tzImagePickerVc.fullImageBtnTitleStr forState: UIControlStateSelected];
245
258
[_originalPhotoButton setTitleColor: [UIColor lightGrayColor ] forState: UIControlStateNormal];
246
- [_originalPhotoButton setTitleColor: [UIColor blackColor ] forState: UIControlStateSelected];
259
+ if (@available (iOS 13.0 , *)) {
260
+ [_originalPhotoButton setTitleColor: [UIColor labelColor ] forState: UIControlStateSelected];
261
+ } else {
262
+ [_originalPhotoButton setTitleColor: [UIColor blackColor ] forState: UIControlStateSelected];
263
+ }
247
264
[_originalPhotoButton setImage: tzImagePickerVc.photoOriginDefImage forState: UIControlStateNormal];
248
265
[_originalPhotoButton setImage: tzImagePickerVc.photoOriginSelImage forState: UIControlStateSelected];
249
266
_originalPhotoButton.imageView .clipsToBounds = YES ;
@@ -254,7 +271,11 @@ - (void)configBottomToolBar {
254
271
_originalPhotoLabel = [[UILabel alloc ] init ];
255
272
_originalPhotoLabel.textAlignment = NSTextAlignmentLeft;
256
273
_originalPhotoLabel.font = [UIFont systemFontOfSize: 16 ];
257
- _originalPhotoLabel.textColor = [UIColor blackColor ];
274
+ if (@available (iOS 13.0 , *)) {
275
+ _originalPhotoLabel.textColor = [UIColor labelColor ];
276
+ } else {
277
+ _originalPhotoLabel.textColor = [UIColor blackColor ];
278
+ }
258
279
if (_isSelectOriginalPhoto) [self getSelectedPhotoBytes ];
259
280
}
260
281
@@ -284,7 +305,19 @@ - (void)configBottomToolBar {
284
305
285
306
_divideLine = [[UIView alloc ] init ];
286
307
CGFloat rgb2 = 222 / 255.0 ;
287
- _divideLine.backgroundColor = [UIColor colorWithRed: rgb2 green: rgb2 blue: rgb2 alpha: 1.0 ];
308
+ if (@available (iOS 13.0 , *)) {
309
+ UIColor *divideLineDyColor = [UIColor colorWithDynamicProvider: ^UIColor * _Nonnull (UITraitCollection * _Nonnull trainCollection) {
310
+ if ([trainCollection userInterfaceStyle ] == UIUserInterfaceStyleLight) {
311
+ return [UIColor colorWithRed: rgb2 green: rgb2 blue: rgb2 alpha: 1.0 ];
312
+ } else {
313
+ CGFloat lineDarkRgb = 100 / 255.0 ;
314
+ return [UIColor colorWithRed: lineDarkRgb green: lineDarkRgb blue: lineDarkRgb alpha: 1.0 ];
315
+ }
316
+ }];
317
+ _divideLine.backgroundColor = divideLineDyColor;
318
+ } else {
319
+ _divideLine.backgroundColor = [UIColor colorWithRed: rgb2 green: rgb2 blue: rgb2 alpha: 1.0 ];
320
+ }
288
321
289
322
[_bottomToolBar addSubview: _divideLine];
290
323
[_bottomToolBar addSubview: _previewButton];
0 commit comments