Skip to content

Commit

Permalink
自测中英文UI适配
Browse files Browse the repository at this point in the history
Change-Id: I3a6f0b94813b0ed9d3b4529a024b4e8ae215022b
  • Loading branch information
ccharlesren committed Apr 9, 2021
1 parent eac332b commit 6d1748c
Showing 1 changed file with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,25 @@ - (void)setupUI{
}

UILabel *tipLabel = [[UILabel alloc] init];
tipLabel.bounds = CGRectMake(0, 0, kScreenWidth/_titlesArray.count, stepLabelWidth);
tipLabel.text = _titlesArray[i];
tipLabel.numberOfLines = 0;
tipLabel.font = [UIFont wcPfRegularFontOfSize:12];
[tipLabel sizeToFit];
CGFloat xOffet = stepLabel.center.x;
if (i == 0) {
xOffet = stepLabel.center.x + 20;
if (LanguageIsEnglish) {
tipLabel.bounds = CGRectMake(0, 0, kScreenWidth/_titlesArray.count, stepLabelWidth);
tipLabel.numberOfLines = 0;
CGFloat xOffet = stepLabel.center.x;
if (i == 0) {
xOffet = stepLabel.center.x + 20;
}
tipLabel.text = _titlesArray[i];
tipLabel.font = [UIFont wcPfRegularFontOfSize:12];
[tipLabel sizeToFit];
tipLabel.center = CGPointMake(xOffet, CGRectGetMaxY(stepLabel.frame) + 18.0f);
}else {
tipLabel.bounds = CGRectMake(0, 0, stepLabelWidth, stepLabelWidth);
tipLabel.text = _titlesArray[i];
tipLabel.font = [UIFont wcPfRegularFontOfSize:12];
[tipLabel sizeToFit];
tipLabel.center = CGPointMake(stepLabel.center.x, CGRectGetMaxY(stepLabel.frame) + 18.0f);
}
tipLabel.center = CGPointMake(xOffet, CGRectGetMaxY(stepLabel.frame) + 18.0f);

[self addSubview:tipLabel];

if (self.step < i+1) {
Expand Down

0 comments on commit 6d1748c

Please sign in to comment.