1
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB |
@@ -5,12 +5,12 @@
|
|||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "微信图片_20251107154239_220_763.png",
|
"filename" : "home_rank_1@2x.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "微信图片_20251107154239_220_763 1.png",
|
"filename" : "home_rank_1@3x.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
}
|
}
|
||||||
BIN
keyBoard/Assets.xcassets/Home/home_rank_1.imageset/home_rank_1@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_rank_1.imageset/home_rank_1@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 28 KiB |
@@ -5,12 +5,12 @@
|
|||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "微信图片_20251107154240_221_763.png",
|
"filename" : "home_rank_2@2x.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename" : "微信图片_20251107154240_221_763 1.png",
|
"filename" : "home_rank_2@3x.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
}
|
}
|
||||||
BIN
keyBoard/Assets.xcassets/Home/home_rank_2.imageset/home_rank_2@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_rank_2.imageset/home_rank_2@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 29 KiB |
22
keyBoard/Assets.xcassets/Home/home_rank_3.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "home_rank_3@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "home_rank_3@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
keyBoard/Assets.xcassets/Home/home_rank_3.imageset/home_rank_3@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
keyBoard/Assets.xcassets/Home/home_rank_3.imageset/home_rank_3@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB |
22
keyBoard/Assets.xcassets/Home/recharge_now_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "recharge_now_icon@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "recharge_now_icon@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
keyBoard/Assets.xcassets/Home/recharge_now_icon.imageset/recharge_now_icon@2x.png
vendored
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
keyBoard/Assets.xcassets/Home/recharge_now_icon.imageset/recharge_now_icon@3x.png
vendored
Normal file
|
After Width: | Height: | Size: 43 KiB |
@@ -39,18 +39,6 @@
|
|||||||
#pragma mark - Layout
|
#pragma mark - Layout
|
||||||
- (void)layoutSubviews {
|
- (void)layoutSubviews {
|
||||||
[super layoutSubviews];
|
[super layoutSubviews];
|
||||||
// 根据实际尺寸更新购买按钮背景的渐变图(避免在未布局前计算尺寸为0)
|
|
||||||
if (self.buyButton.currentBackgroundImage == nil) {
|
|
||||||
CGSize size = self.buyButton.bounds.size;
|
|
||||||
if (size.width > 0 && size.height > 0) {
|
|
||||||
UIImage *bg = [UIImage kb_gradientImageWithColors:@[[UIColor colorWithHex:0xE6FFF4], [UIColor colorWithHex:0xA6FFD8]]
|
|
||||||
locations:nil
|
|
||||||
size:size
|
|
||||||
direction:KBGradientDirectionLeftToRight
|
|
||||||
cornerRadius:size.height * 0.5];
|
|
||||||
[self.buyButton setBackgroundImage:bg forState:UIControlStateNormal];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - UI
|
#pragma mark - UI
|
||||||
@@ -126,7 +114,7 @@
|
|||||||
[self.buyButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.buyButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.mas_left).offset(62);
|
make.left.equalTo(self.mas_left).offset(62);
|
||||||
make.right.equalTo(self.mas_right).offset(-62);
|
make.right.equalTo(self.mas_right).offset(-62);
|
||||||
make.bottom.equalTo(self.mas_bottom).offset(-5);
|
make.bottom.equalTo(self.mas_bottom).offset(0);
|
||||||
make.height.mas_equalTo(56);
|
make.height.mas_equalTo(56);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
@@ -240,7 +228,7 @@
|
|||||||
[_buyButton setTitle:@"Recharge Now" forState:UIControlStateNormal];
|
[_buyButton setTitle:@"Recharge Now" forState:UIControlStateNormal];
|
||||||
[_buyButton setTitleColor:[UIColor colorWithHex:0x1B1F1A] forState:UIControlStateNormal];
|
[_buyButton setTitleColor:[UIColor colorWithHex:0x1B1F1A] forState:UIControlStateNormal];
|
||||||
_buyButton.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
|
_buyButton.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
|
||||||
|
[_buyButton setBackgroundImage:[UIImage imageNamed:@"recharge_now_icon"] forState:UIControlStateNormal];
|
||||||
[_buyButton addTarget:self action:@selector(onTapBuyAction) forControlEvents:UIControlEventTouchUpInside];
|
[_buyButton addTarget:self action:@selector(onTapBuyAction) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
return _buyButton;
|
return _buyButton;
|
||||||
|
|||||||