1
This commit is contained in:
@@ -212,7 +212,7 @@
|
||||
|
||||
// 两个按钮
|
||||
self.hotButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[self.hotButton setTitle:@"Ranking List" forState:UIControlStateNormal];
|
||||
[self.hotButton setTitle:KBLocalized(@"Ranking List") forState:UIControlStateNormal];
|
||||
[self.hotButton setTitleColor:[UIColor darkTextColor] forState:UIControlStateNormal];
|
||||
[self.hotButton setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
|
||||
self.hotButton.titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
@@ -221,7 +221,7 @@
|
||||
[self.topBar addSubview:self.hotButton];
|
||||
|
||||
self.rankButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[self.rankButton setTitle:@"Persona circle" forState:UIControlStateNormal];
|
||||
[self.rankButton setTitle:KBLocalized(@"Persona circle") forState:UIControlStateNormal];
|
||||
[self.rankButton setTitleColor:[UIColor darkTextColor] forState:UIControlStateNormal];
|
||||
[self.rankButton setTitleColor:[UIColor blackColor] forState:UIControlStateSelected];
|
||||
self.rankButton.titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
[_applyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.equalTo(self.contentView).offset(-16);
|
||||
make.centerY.equalTo(self.contentView);
|
||||
make.width.mas_equalTo(110);
|
||||
make.width.mas_greaterThanOrEqualTo(110);
|
||||
make.height.mas_equalTo(34);
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
make.centerY.equalTo(self.titleLabel);
|
||||
make.right.equalTo(self).offset(-20);
|
||||
make.height.mas_equalTo(34);
|
||||
make.width.mas_greaterThanOrEqualTo(110);
|
||||
make.width.mas_greaterThanOrEqualTo(90);
|
||||
}];
|
||||
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self).offset(26);
|
||||
@@ -124,14 +124,22 @@
|
||||
_keyboardBtn.layer.cornerRadius = 17;
|
||||
_keyboardBtn.layer.masksToBounds = YES;
|
||||
|
||||
// 图标 + 文本,图文间距 6
|
||||
// 图标 + 文本,保持不同语言下左右内边距一致
|
||||
UIImage *kbImg = [UIImage imageNamed:@"my_kb_icon"];
|
||||
if (kbImg) {
|
||||
[_keyboardBtn setImage:kbImg forState:UIControlStateNormal];
|
||||
_keyboardBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
CGFloat spacing = 3.0;
|
||||
_keyboardBtn.contentEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, spacing);
|
||||
_keyboardBtn.titleEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, -spacing);
|
||||
// 按钮左右内边距(与文字无关,始终生效)
|
||||
CGFloat horizontalPadding = 10.0;
|
||||
_keyboardBtn.contentEdgeInsets = UIEdgeInsetsMake(0, horizontalPadding, 0, horizontalPadding);
|
||||
// 图片与文字之间的间距
|
||||
CGFloat spacing = 6.0;
|
||||
_keyboardBtn.imageEdgeInsets = UIEdgeInsetsMake(0, -spacing / 2.0, 0, spacing / 2.0);
|
||||
_keyboardBtn.titleEdgeInsets = UIEdgeInsetsMake(0, spacing / 2.0, 0, -spacing / 2.0);
|
||||
|
||||
// 保证宽度由内容决定,避免中英文长度不同导致被压扁
|
||||
[_keyboardBtn setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
[_keyboardBtn setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
}
|
||||
|
||||
// 点击事件
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
[self.searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self.bgView);
|
||||
make.right.equalTo(self.bgView).offset(-8);
|
||||
make.width.mas_equalTo(84);
|
||||
make.width.mas_greaterThanOrEqualTo(84);
|
||||
make.height.mas_equalTo(32);
|
||||
}];
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
[self.rechargeButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.equalTo(self.infoCard).offset(-32);
|
||||
make.right.equalTo(self.infoCard).offset(-15);
|
||||
make.width.mas_equalTo(114);
|
||||
make.width.mas_greaterThanOrEqualTo(114);
|
||||
make.height.mas_equalTo(42);
|
||||
}];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user