Commit 11860af7 authored by yuzheng's avatar yuzheng

feat: adjustsFontSizeToFitWidth

parent 41cc0b77
...@@ -293,6 +293,7 @@ ...@@ -293,6 +293,7 @@
if (_indexLabel == nil) { if (_indexLabel == nil) {
UILabel *indexLabel = [[UILabel alloc] init]; UILabel *indexLabel = [[UILabel alloc] init];
indexLabel.font = [UIFont systemFontOfSize:14]; indexLabel.font = [UIFont systemFontOfSize:14];
indexLabel.adjustsFontSizeToFitWidth = YES;
indexLabel.textColor = [UIColor whiteColor]; indexLabel.textColor = [UIColor whiteColor];
indexLabel.textAlignment = NSTextAlignmentCenter; indexLabel.textAlignment = NSTextAlignmentCenter;
[self.contentView addSubview:indexLabel]; [self.contentView addSubview:indexLabel];
...@@ -434,6 +435,7 @@ ...@@ -434,6 +435,7 @@
- (UIButton *)selectedCountButton { - (UIButton *)selectedCountButton {
if (_selectedCountButton == nil) { if (_selectedCountButton == nil) {
UIButton *selectedCountButton = [[UIButton alloc] init]; UIButton *selectedCountButton = [[UIButton alloc] init];
selectedCountButton.titleLabel.adjustsFontSizeToFitWidth = YES;
selectedCountButton.layer.cornerRadius = 12; selectedCountButton.layer.cornerRadius = 12;
selectedCountButton.clipsToBounds = YES; selectedCountButton.clipsToBounds = YES;
selectedCountButton.backgroundColor = [UIColor redColor]; selectedCountButton.backgroundColor = [UIColor redColor];
......
...@@ -263,6 +263,7 @@ static CGFloat itemMargin = 5; ...@@ -263,6 +263,7 @@ static CGFloat itemMargin = 5;
_numberLabel = [[UILabel alloc] init]; _numberLabel = [[UILabel alloc] init];
_numberLabel.font = [UIFont systemFontOfSize:15]; _numberLabel.font = [UIFont systemFontOfSize:15];
_numberLabel.adjustsFontSizeToFitWidth = YES;
_numberLabel.textColor = [UIColor whiteColor]; _numberLabel.textColor = [UIColor whiteColor];
_numberLabel.textAlignment = NSTextAlignmentCenter; _numberLabel.textAlignment = NSTextAlignmentCenter;
_numberLabel.text = [NSString stringWithFormat:@"%zd",tzImagePickerVc.selectedModels.count]; _numberLabel.text = [NSString stringWithFormat:@"%zd",tzImagePickerVc.selectedModels.count];
......
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
_selectButton.hidden = !tzImagePickerVc.showSelectBtn; _selectButton.hidden = !tzImagePickerVc.showSelectBtn;
_indexLabel = [[UILabel alloc] init]; _indexLabel = [[UILabel alloc] init];
_indexLabel.adjustsFontSizeToFitWidth = YES;
_indexLabel.font = [UIFont systemFontOfSize:14]; _indexLabel.font = [UIFont systemFontOfSize:14];
_indexLabel.textColor = [UIColor whiteColor]; _indexLabel.textColor = [UIColor whiteColor];
_indexLabel.textAlignment = NSTextAlignmentCenter; _indexLabel.textAlignment = NSTextAlignmentCenter;
...@@ -170,6 +171,7 @@ ...@@ -170,6 +171,7 @@
_numberLabel = [[UILabel alloc] init]; _numberLabel = [[UILabel alloc] init];
_numberLabel.font = [UIFont systemFontOfSize:15]; _numberLabel.font = [UIFont systemFontOfSize:15];
_numberLabel.adjustsFontSizeToFitWidth = YES;
_numberLabel.textColor = [UIColor whiteColor]; _numberLabel.textColor = [UIColor whiteColor];
_numberLabel.textAlignment = NSTextAlignmentCenter; _numberLabel.textAlignment = NSTextAlignmentCenter;
_numberLabel.text = [NSString stringWithFormat:@"%zd",_tzImagePickerVc.selectedModels.count]; _numberLabel.text = [NSString stringWithFormat:@"%zd",_tzImagePickerVc.selectedModels.count];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment