@@ -166,7 +166,11 @@ - (void)configCollectionView {
166166 if (!_collectionView) {
167167 _layout = [[UICollectionViewFlowLayout alloc ] init ];
168168 _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+ }
170174 _collectionView.dataSource = self;
171175 _collectionView.delegate = self;
172176 _collectionView.alwaysBounceHorizontal = NO ;
@@ -177,6 +181,7 @@ - (void)configCollectionView {
177181 } else {
178182 [_collectionView reloadData ];
179183 }
184+
180185
181186 if (_showTakePhotoBtn) {
182187 _collectionView.contentSize = CGSizeMake (self.view .tz_width , ((_model.count + self.columnNumber ) / self.columnNumber ) * self.view .tz_width );
@@ -224,14 +229,22 @@ - (void)configBottomToolBar {
224229
225230 _bottomToolBar = [[UIView alloc ] initWithFrame: CGRectZero];
226231 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+ }
228237
229238 _previewButton = [UIButton buttonWithType: UIButtonTypeCustom];
230239 [_previewButton addTarget: self action: @selector (previewButtonClick ) forControlEvents: UIControlEventTouchUpInside];
231240 _previewButton.titleLabel .font = [UIFont systemFontOfSize: 16 ];
232241 [_previewButton setTitle: tzImagePickerVc.previewBtnTitleStr forState: UIControlStateNormal];
233242 [_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+ }
235248 [_previewButton setTitleColor: [UIColor lightGrayColor ] forState: UIControlStateDisabled];
236249 _previewButton.enabled = tzImagePickerVc.selectedModels .count ;
237250
@@ -243,7 +256,11 @@ - (void)configBottomToolBar {
243256 [_originalPhotoButton setTitle: tzImagePickerVc.fullImageBtnTitleStr forState: UIControlStateNormal];
244257 [_originalPhotoButton setTitle: tzImagePickerVc.fullImageBtnTitleStr forState: UIControlStateSelected];
245258 [_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+ }
247264 [_originalPhotoButton setImage: tzImagePickerVc.photoOriginDefImage forState: UIControlStateNormal];
248265 [_originalPhotoButton setImage: tzImagePickerVc.photoOriginSelImage forState: UIControlStateSelected];
249266 _originalPhotoButton.imageView .clipsToBounds = YES ;
@@ -254,7 +271,11 @@ - (void)configBottomToolBar {
254271 _originalPhotoLabel = [[UILabel alloc ] init ];
255272 _originalPhotoLabel.textAlignment = NSTextAlignmentLeft;
256273 _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+ }
258279 if (_isSelectOriginalPhoto) [self getSelectedPhotoBytes ];
259280 }
260281
@@ -284,7 +305,19 @@ - (void)configBottomToolBar {
284305
285306 _divideLine = [[UIView alloc ] init ];
286307 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+ }
288321
289322 [_bottomToolBar addSubview: _divideLine];
290323 [_bottomToolBar addSubview: _previewButton];
0 commit comments