diff --git a/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_long.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_long.imageset/Contents.json new file mode 100644 index 00000000..7a961f41 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_long.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_party_recommand_tag_long@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_party_recommand_tag_long@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_long.imageset/home_party_recommand_tag_long@2x.png b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_long.imageset/home_party_recommand_tag_long@2x.png new file mode 100644 index 00000000..a09a4ddc Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_long.imageset/home_party_recommand_tag_long@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_long.imageset/home_party_recommand_tag_long@3x.png b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_long.imageset/home_party_recommand_tag_long@3x.png new file mode 100644 index 00000000..58984dcb Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_long.imageset/home_party_recommand_tag_long@3x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_short.imageset/Contents.json b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_short.imageset/Contents.json new file mode 100644 index 00000000..f2ec75fd --- /dev/null +++ b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_short.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_party_recommand_tag_short@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_party_recommand_tag_short@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_short.imageset/home_party_recommand_tag_short@2x.png b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_short.imageset/home_party_recommand_tag_short@2x.png new file mode 100644 index 00000000..84058031 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_short.imageset/home_party_recommand_tag_short@2x.png differ diff --git a/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_short.imageset/home_party_recommand_tag_short@3x.png b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_short.imageset/home_party_recommand_tag_short@3x.png new file mode 100644 index 00000000..e47a0b83 Binary files /dev/null and b/xplan-ios/Assets.xcassets/Home/home_party_recommand_tag_short.imageset/home_party_recommand_tag_short@3x.png differ diff --git a/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.m b/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.m index a0b1e6d8..15f143f7 100644 --- a/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.m +++ b/xplan-ios/Main/Home/View/XPPartyListCollectionViewCell.m @@ -105,7 +105,8 @@ [self.tagButton mas_makeConstraints:^(MASConstraintMaker *make) { make.top.left.mas_equalTo(self.roomTagImageView); - make.size.mas_equalTo(CGSizeMake(43, 16)); + make.width.mas_equalTo(53); + make.height.mas_equalTo(16); }]; [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -206,8 +207,23 @@ self.tagButton.hidden = NO; if (_roomModel.crossPking) { [self.tagButton setTitle:@"PK中" forState:UIControlStateNormal]; + [self.tagButton setBackgroundImage:[UIImage imageNamed:@"home_party_recommand_tag_short"] forState:UIControlStateNormal]; + [self.tagButton mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(38); + }]; } else { [self.tagButton setTitle:_roomModel.iconContent forState:UIControlStateNormal]; + if (_roomModel.iconContent.length <= 2) { + [self.tagButton setBackgroundImage:[UIImage imageNamed:@"home_party_recommand_tag_short"] forState:UIControlStateNormal]; + [self.tagButton mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(38); + }]; + }else{ + [self.tagButton setBackgroundImage:[UIImage imageNamed:@"home_party_recommand_tag_long"] forState:UIControlStateNormal]; + [self.tagButton mas_updateConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(53); + }]; + } } }else{ self.tagButton.hidden = YES; @@ -275,7 +291,6 @@ _tagButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_tagButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; _tagButton.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium]; - [_tagButton setBackgroundImage:[UIImage imageNamed:@"home_recommend_tag_bg"] forState:UIControlStateNormal]; _tagButton.hidden = YES; _tagButton.userInteractionEnabled = NO; } diff --git a/xplan-ios/Main/Home/View/XPPartyListViewController.m b/xplan-ios/Main/Home/View/XPPartyListViewController.m index 36fb3c5f..19be4658 100644 --- a/xplan-ios/Main/Home/View/XPPartyListViewController.m +++ b/xplan-ios/Main/Home/View/XPPartyListViewController.m @@ -115,7 +115,7 @@ - (void)initSubViewConstraints { [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.bottom.mas_equalTo(self.view); - make.top.mas_equalTo(8); + make.top.mas_equalTo(6); }]; }