Przeglądaj źródła

PK 排行榜 UI 完善

SuperC 1 rok temu
rodzic
commit
86d001152c

BIN
MiMoLive/MiMoLive.xcworkspace/xcuserdata/yanxuyao.xcuserdatad/UserInterfaceState.xcuserstate


+ 22 - 0
MiMoLive/MiMoLive/Assets.xcassets/Explore/Rank/icon_pk_center.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "icon_pk_center@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "icon_pk_center@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
MiMoLive/MiMoLive/Assets.xcassets/Explore/Rank/icon_pk_center.imageset/icon_pk_center@2x.png


BIN
MiMoLive/MiMoLive/Assets.xcassets/Explore/Rank/icon_pk_center.imageset/icon_pk_center@3x.png


BIN
MiMoLive/MiMoLive/Assets.xcassets/Explore/Rank/icon_pk_rank_win.imageset/icon_pk_rank_win@2x.png


BIN
MiMoLive/MiMoLive/Assets.xcassets/Explore/Rank/icon_pk_rank_win.imageset/icon_pk_rank_win@3x.png


+ 10 - 3
MiMoLive/MiMoLive/Classes/Explore/View/PkRankListView/MOPkRankListCell.m

@@ -42,6 +42,13 @@
     
     self.backgroundColor = [UIColor clearColor];
     
+    self.leftNameLab.font = [MOTextTools getTheFontWithSize:14.0 AndFontName:@"Akrobat"];
+    self.rightNameLab.font = [MOTextTools getTheFontWithSize:14.0 AndFontName:@"Akrobat"];
+    [self.winNumBtn setFont:[MOTextTools getTheFontWithSize:12.0 AndFontName:@"Akrobat"]];
+    [self.rightNumBtn setFont:[MOTextTools getTheFontWithSize:12.0 AndFontName:@"Akrobat"]];
+    
+    [self.rankNumBtn setFont:[MOTextTools getTheFontWithSize:20.0 AndFontName:@"Akrobat"]];
+    
     self.bgView.layer.cornerRadius = 16.0;
     self.bgView.layer.masksToBounds = YES;
     
@@ -119,15 +126,15 @@
     [self.rankNumBtn setTitle:@"" forState:UIControlStateNormal];
     
     if(self.cellIndexPath.row == 0){
-        [self.rankNumBtn setBackgroundImage:[UIImage imageNamed:@"icon_half_hour_one"] forState:UIControlStateNormal];
+        [self.rankNumBtn setBackgroundImage:[UIImage imageNamed:@"icon_voice_rank_jin"] forState:UIControlStateNormal];
         [self.crownBtn setImage:[UIImage imageNamed:@"icon_half_hour_jin"]];
     }
     else if (self.cellIndexPath.row == 1){
-        [self.rankNumBtn setBackgroundImage:[UIImage imageNamed:@"icon_half_hour_two"] forState:UIControlStateNormal];
+        [self.rankNumBtn setBackgroundImage:[UIImage imageNamed:@"icon_voice_rank_yin"] forState:UIControlStateNormal];
         [self.crownBtn setImage:[UIImage imageNamed:@"icon_half_hour_yin"]];
     }
     else if (self.cellIndexPath.row == 2){
-        [self.rankNumBtn setBackgroundImage:[UIImage imageNamed:@"icon_half_hour_three"] forState:UIControlStateNormal];
+        [self.rankNumBtn setBackgroundImage:[UIImage imageNamed:@"icon_voice_rank_tong"] forState:UIControlStateNormal];
         [self.crownBtn setImage:[UIImage imageNamed:@"icon_half_hour_tong"]];
     }
     else{

+ 33 - 23
MiMoLive/MiMoLive/Classes/Explore/View/PkRankListView/MOPkRankListCell.xib

@@ -18,54 +18,61 @@
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3gY-hA-QT8">
-                        <rect key="frame" x="10" y="5" width="316" height="88"/>
+                        <rect key="frame" x="10" y="4" width="316" height="85"/>
                         <subviews>
+                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_pk_center" translatesAutoresizingMaskIntoConstraints="NO" id="CjI-7g-KqC">
+                                <rect key="frame" x="163" y="3.6666666666666643" width="30" height="78"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="78" id="QRV-IT-led"/>
+                                    <constraint firstAttribute="width" constant="30" id="pRZ-to-Ztp"/>
+                                </constraints>
+                            </imageView>
                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8vh-QS-OeS">
-                                <rect key="frame" x="8" y="34" width="20" height="20"/>
+                                <rect key="frame" x="8" y="29.666666666666664" width="28" height="26"/>
                                 <constraints>
-                                    <constraint firstAttribute="height" constant="20" id="6dc-ri-1b3"/>
-                                    <constraint firstAttribute="width" constant="20" id="JW8-9C-1sw"/>
+                                    <constraint firstAttribute="height" constant="26" id="6dc-ri-1b3"/>
+                                    <constraint firstAttribute="width" constant="28" id="JW8-9C-1sw"/>
                                 </constraints>
                                 <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                 <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                 <state key="normal" backgroundImage="icon_half_hour_one">
-                                    <color key="titleColor" red="0.89411764705882346" green="0.89411764705882346" blue="0.89411764705882346" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                    <color key="titleColor" red="0.73725490196078436" green="0.73725490196078436" blue="0.73725490196078436" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                 </state>
                             </button>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="vy7-m6-z94">
-                                <rect key="frame" x="33" y="20" width="48" height="48"/>
+                                <rect key="frame" x="41" y="18.666666666666671" width="48" height="48"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="48" id="Ooc-Vc-chW"/>
                                     <constraint firstAttribute="height" constant="48" id="Sl9-ro-jpP"/>
                                 </constraints>
                             </imageView>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_half_hour_jin" translatesAutoresizingMaskIntoConstraints="NO" id="miO-Kc-NMH">
-                                <rect key="frame" x="33" y="20" width="20" height="18"/>
+                                <rect key="frame" x="41" y="18.666666666666668" width="20" height="18.000000000000004"/>
                                 <constraints>
                                     <constraint firstAttribute="height" constant="18" id="IOe-DY-3er"/>
                                     <constraint firstAttribute="width" constant="20" id="Xgb-YQ-bXf"/>
                                 </constraints>
                             </imageView>
                             <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="1e6-2w-BSV">
-                                <rect key="frame" x="260" y="20" width="48" height="48"/>
+                                <rect key="frame" x="260" y="18.666666666666671" width="48" height="48"/>
                                 <constraints>
                                     <constraint firstAttribute="width" constant="48" id="OE0-Sw-iPV"/>
                                     <constraint firstAttribute="height" constant="48" id="kqb-uh-Scx"/>
                                 </constraints>
                             </imageView>
-                            <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="xbf-o2-Ymz">
-                                <rect key="frame" x="91" y="26" width="159" height="16"/>
+                            <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="30" translatesAutoresizingMaskIntoConstraints="NO" id="xbf-o2-Ymz">
+                                <rect key="frame" x="99" y="24.666666666666671" width="151" height="16"/>
                                 <subviews>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Jong" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qk7-tv-9Dg">
-                                        <rect key="frame" x="0.0" y="0.0" width="79.666666666666671" height="16"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="60.666666666666664" height="16"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                                        <color key="textColor" red="0.89411764705882346" green="0.89411764705882346" blue="0.89411764705882346" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        <color key="textColor" red="0.15686274509803921" green="0.15686274509803921" blue="0.15686274509803921" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                     <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Rock" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zBg-Xv-qQp">
-                                        <rect key="frame" x="79.666666666666657" y="0.0" width="79.333333333333343" height="16"/>
+                                        <rect key="frame" x="90.666666666666657" y="0.0" width="60.333333333333343" height="16"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="14"/>
-                                        <color key="textColor" red="0.89411764705882346" green="0.89411764705882346" blue="0.89411764705882346" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                        <color key="textColor" red="0.15686274509803921" green="0.15686274509803921" blue="0.15686274509803921" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         <nil key="highlightedColor"/>
                                     </label>
                                 </subviews>
@@ -74,22 +81,22 @@
                                 </constraints>
                             </stackView>
                             <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="juq-Ou-3zC">
-                                <rect key="frame" x="91" y="47" width="159" height="20"/>
+                                <rect key="frame" x="99" y="45.666666666666664" width="151" height="19.999999999999993"/>
                                 <subviews>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="VWl-Ub-2la">
-                                        <rect key="frame" x="0.0" y="0.0" width="79.666666666666671" height="20"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="75.666666666666671" height="20"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="10"/>
                                         <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                         <state key="normal" title="100" image="icon_pk_rank_win">
-                                            <color key="titleColor" red="0.58823529411764708" green="0.5725490196078431" blue="0.59215686274509804" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            <color key="titleColor" red="0.59607843137254901" green="0.56862745098039214" blue="0.61176470588235299" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         </state>
                                     </button>
                                     <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="right" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hs1-bU-WaL">
-                                        <rect key="frame" x="79.666666666666657" y="0.0" width="79.333333333333343" height="20"/>
+                                        <rect key="frame" x="75.666666666666657" y="0.0" width="75.333333333333343" height="20"/>
                                         <fontDescription key="fontDescription" type="system" pointSize="10"/>
                                         <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
                                         <state key="normal" title="123" image="icon_pk_rank_pk">
-                                            <color key="titleColor" red="0.58823529411764708" green="0.5725490196078431" blue="0.59215686274509804" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            <color key="titleColor" red="0.59607843137254901" green="0.56862745098039214" blue="0.61176470588235299" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                         </state>
                                     </button>
                                 </subviews>
@@ -98,7 +105,7 @@
                                 </constraints>
                             </stackView>
                         </subviews>
-                        <color key="backgroundColor" red="0.16078431372549018" green="0.10588235294117647" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                         <constraints>
                             <constraint firstItem="miO-Kc-NMH" firstAttribute="leading" secondItem="vy7-m6-z94" secondAttribute="leading" id="0Vv-SP-2fD"/>
                             <constraint firstItem="vy7-m6-z94" firstAttribute="centerY" secondItem="3gY-hA-QT8" secondAttribute="centerY" id="0ml-w3-9GQ"/>
@@ -106,9 +113,11 @@
                             <constraint firstItem="xbf-o2-Ymz" firstAttribute="centerY" secondItem="3gY-hA-QT8" secondAttribute="centerY" constant="-10" id="5Kp-NO-neK"/>
                             <constraint firstItem="1e6-2w-BSV" firstAttribute="leading" secondItem="juq-Ou-3zC" secondAttribute="trailing" constant="10" id="8mm-cy-gcN"/>
                             <constraint firstItem="8vh-QS-OeS" firstAttribute="centerY" secondItem="3gY-hA-QT8" secondAttribute="centerY" id="J4D-a9-WeO"/>
+                            <constraint firstItem="CjI-7g-KqC" firstAttribute="centerY" secondItem="3gY-hA-QT8" secondAttribute="centerY" id="JC0-Wg-z7q"/>
                             <constraint firstItem="juq-Ou-3zC" firstAttribute="leading" secondItem="vy7-m6-z94" secondAttribute="trailing" constant="10" id="Xc0-Og-Z2E"/>
                             <constraint firstItem="8vh-QS-OeS" firstAttribute="leading" secondItem="3gY-hA-QT8" secondAttribute="leading" constant="8" id="ZbW-FR-abx"/>
                             <constraint firstAttribute="trailing" secondItem="1e6-2w-BSV" secondAttribute="trailing" constant="8" id="a70-zg-Zt1"/>
+                            <constraint firstItem="CjI-7g-KqC" firstAttribute="centerX" secondItem="3gY-hA-QT8" secondAttribute="centerX" constant="20" id="jIq-YK-nGF"/>
                             <constraint firstItem="1e6-2w-BSV" firstAttribute="centerY" secondItem="3gY-hA-QT8" secondAttribute="centerY" id="s6K-Ny-fk2"/>
                             <constraint firstItem="xbf-o2-Ymz" firstAttribute="leading" secondItem="vy7-m6-z94" secondAttribute="trailing" constant="10" id="uIk-v2-KYS"/>
                             <constraint firstItem="vy7-m6-z94" firstAttribute="leading" secondItem="8vh-QS-OeS" secondAttribute="trailing" constant="5" id="uyh-Im-ZO7"/>
@@ -119,9 +128,9 @@
                 </subviews>
                 <constraints>
                     <constraint firstItem="3gY-hA-QT8" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="10" id="4nY-NO-8KW"/>
-                    <constraint firstItem="3gY-hA-QT8" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="5" id="HAz-gZ-Hve"/>
+                    <constraint firstItem="3gY-hA-QT8" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="4" id="HAz-gZ-Hve"/>
                     <constraint firstAttribute="trailing" secondItem="3gY-hA-QT8" secondAttribute="trailing" constant="10" id="eAd-fk-vVs"/>
-                    <constraint firstAttribute="bottom" secondItem="3gY-hA-QT8" secondAttribute="bottom" id="v1P-7G-EWI"/>
+                    <constraint firstAttribute="bottom" secondItem="3gY-hA-QT8" secondAttribute="bottom" constant="4" id="v1P-7G-EWI"/>
                 </constraints>
             </tableViewCellContentView>
             <viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
@@ -141,7 +150,8 @@
     </objects>
     <resources>
         <image name="icon_half_hour_jin" width="27.333333969116211" height="25"/>
-        <image name="icon_half_hour_one" width="20" height="22"/>
+        <image name="icon_half_hour_one" width="19.333333969116211" height="21"/>
+        <image name="icon_pk_center" width="29.666666030883789" height="78.666664123535156"/>
         <image name="icon_pk_rank_pk" width="19.333333969116211" height="20"/>
         <image name="icon_pk_rank_win" width="18.333333969116211" height="20"/>
     </resources>

+ 102 - 27
MiMoLive/MiMoLive/Classes/Explore/View/PkRankListView/MOPkRankListView.m

@@ -8,7 +8,7 @@
 #import "MOPkRankListView.h"
 #import "MOPkRankTableView.h"
 
-@interface MOPkRankListView ()
+@interface MOPkRankListView ()<JXCategoryViewDelegate>
 
 @property (weak, nonatomic) IBOutlet UIButton *leftWeekBtn;
 
@@ -20,6 +20,9 @@
 
 @property (nonatomic, assign) NSInteger selectIndex;
 
+@property (nonatomic, strong) JXCategoryTitleView *titleCategoryView;
+@property (nonatomic, strong) UIView *titleBgView;
+
 @end
 
 @implementation MOPkRankListView
@@ -31,39 +34,83 @@
 - (void)awakeFromNib{
     [super awakeFromNib];
     
-    [self addSubview:self.lastWeekTableView];
-    [self.lastWeekTableView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self).offset(50.0);
-        make.left.right.bottom.equalTo(self);
+    [self addSubview:self.titleBgView];
+    [self.titleBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self).offset(15.0);
+        make.left.equalTo(self).offset(66.0);
+        make.right.equalTo(self).offset(-66.0);
+        make.height.equalTo(@32.0);
     }];
+    self.titleBgView.layer.cornerRadius = 32.0 / 2.0;
     
-    [self addSubview:self.rightWeekTableView];
-    [self.rightWeekTableView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self).offset(50.0);
-        make.left.right.bottom.equalTo(self);
+    [self addSubview:self.titleCategoryView];
+    [self.titleCategoryView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerY.equalTo(self.titleBgView.mas_centerY);
+        make.left.equalTo(self).offset(45.0);
+        make.right.equalTo(self).offset(-45.0);
+        make.height.equalTo(@70.0);
     }];
     
+    self.titleCategoryView.titles = @[@"Last week",@"This week"];
+    CGFloat totalItemWidth = SCREENWIDTH - 45.0 * 2.0 ;
+    self.titleCategoryView.cellSpacing = 0.0;
+    self.titleCategoryView.cellWidth = totalItemWidth / self.titleCategoryView.titles.count;
+    self.titleCategoryView.titleColor = [MOTools colorWithHexString:@"#737373" alpha:1.0];
+    self.titleCategoryView.titleSelectedColor = kBaseBtnBgColor;
+    self.titleCategoryView.titleFont = [MOTextTools getTheFontWithSize:15.0 AndFontName:@"Akrobat"];
+    self.titleCategoryView.titleSelectedFont = [MOTextTools getTheFontWithSize:15.0 AndFontName:@"Akrobat"];
+    self.titleCategoryView.backgroundColor = [UIColor clearColor];
     
-    [self.leftWeekBtn setTitle:@"Last week" forState:UIControlStateNormal];
-    
-    self.leftWeekBtn.layer.cornerRadius = 30.0 / 2.0;
-    self.leftWeekBtn.layer.masksToBounds = YES;
+    JXCategoryIndicatorBackgroundView *backgroundView = [[JXCategoryIndicatorBackgroundView alloc] init];
+    backgroundView.indicatorHeight = 70.0;
+    backgroundView.indicatorWidth = totalItemWidth / self.titleCategoryView.titles.count + 30.0;
+    backgroundView.indicatorWidthIncrement = 0;
+    backgroundView.indicatorColor = [UIColor clearColor];
+    backgroundView.verticalMargin = 4.0;
     
-    self.rightWeekBtn.layer.cornerRadius = 30.0 / 2.0;
-    self.rightWeekBtn.layer.masksToBounds = YES;
+    UIImageView *imgBgView = [[UIImageView alloc] init];
+    imgBgView.contentMode = UIViewContentModeScaleToFill;
+    [imgBgView setImage:[UIImage imageNamed:@"icon_rank_btn_bg_apple"]];
+    [backgroundView addSubview:imgBgView];
+    [imgBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(backgroundView);
+    }];
     
+    self.titleCategoryView.indicators = @[backgroundView];
     
-    CGFloat btnWidth = (SCREENWIDTH - 50.0 * 2 - 10.0) / 2.0;
-    NSArray *colorArr = @[[MOTools colorWithHexString:@"#7C43B9" alpha:1.0],[MOTools colorWithHexString:@"#AD33B0" alpha:1.0]];
-    UIImage *image = [MOTools createGradientRectImageWithBounds:CGRectMake(0, 0, btnWidth, 30.0) Colors:colorArr GradientType:0];
+    [self addSubview:self.lastWeekTableView];
+    [self.lastWeekTableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self).offset(65.0);
+        make.left.right.bottom.equalTo(self);
+    }];
     
-    UIImage *whiteImg = [MOTools createImageWithColor:[MOTools colorWithHexString:@"#FFFFFF" alpha:0.3]];
+    [self addSubview:self.rightWeekTableView];
+    [self.rightWeekTableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self).offset(65.0);
+        make.left.right.bottom.equalTo(self);
+    }];
     
-    [self.leftWeekBtn setBackgroundImage:whiteImg forState:UIControlStateNormal];
-    [self.leftWeekBtn setBackgroundImage:image forState:UIControlStateSelected];
     
-    [self.rightWeekBtn setBackgroundImage:whiteImg forState:UIControlStateNormal];
-    [self.rightWeekBtn setBackgroundImage:image forState:UIControlStateSelected];
+//    [self.leftWeekBtn setTitle:@"Last week" forState:UIControlStateNormal];
+//    
+//    self.leftWeekBtn.layer.cornerRadius = 30.0 / 2.0;
+//    self.leftWeekBtn.layer.masksToBounds = YES;
+//    
+//    self.rightWeekBtn.layer.cornerRadius = 30.0 / 2.0;
+//    self.rightWeekBtn.layer.masksToBounds = YES;
+//    
+//    
+//    CGFloat btnWidth = (SCREENWIDTH - 50.0 * 2 - 10.0) / 2.0;
+//    NSArray *colorArr = @[[MOTools colorWithHexString:@"#7C43B9" alpha:1.0],[MOTools colorWithHexString:@"#AD33B0" alpha:1.0]];
+//    UIImage *image = [MOTools createGradientRectImageWithBounds:CGRectMake(0, 0, btnWidth, 30.0) Colors:colorArr GradientType:0];
+//    
+//    UIImage *whiteImg = [MOTools createImageWithColor:[MOTools colorWithHexString:@"#FFFFFF" alpha:0.3]];
+//    
+//    [self.leftWeekBtn setBackgroundImage:whiteImg forState:UIControlStateNormal];
+//    [self.leftWeekBtn setBackgroundImage:image forState:UIControlStateSelected];
+//    
+//    [self.rightWeekBtn setBackgroundImage:whiteImg forState:UIControlStateNormal];
+//    [self.rightWeekBtn setBackgroundImage:image forState:UIControlStateSelected];
     
     self.selectIndex = 0;
     
@@ -84,21 +131,31 @@
     _selectIndex = selectIndex;
 
     if(selectIndex == 0){
-        self.leftWeekBtn.selected = YES;
-        self.rightWeekBtn.selected = NO;
+//        self.leftWeekBtn.selected = YES;
+//        self.rightWeekBtn.selected = NO;
         
         self.lastWeekTableView.hidden = NO;
         self.rightWeekTableView.hidden = YES;
     }
     else{
-        self.leftWeekBtn.selected = NO;
-        self.rightWeekBtn.selected = YES;
+//        self.leftWeekBtn.selected = NO;
+//        self.rightWeekBtn.selected = YES;
         
         self.lastWeekTableView.hidden = YES;
         self.rightWeekTableView.hidden = NO;
     }
 }
 
+// 点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,不关心具体是点击还是滚动选中的。
+- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index{
+    if(index == 0){
+        self.selectIndex = 0;
+    }
+    else{
+        self.selectIndex = 1;
+    }
+}
+
 - (MOPkRankTableView *)lastWeekTableView{
     if(!_lastWeekTableView){
         _lastWeekTableView = [[MOPkRankTableView alloc] init];
@@ -125,4 +182,22 @@
     return _rightWeekTableView;
 }
 
+#pragma mark - Lazy
+- (JXCategoryTitleView *)titleCategoryView{
+    if(!_titleCategoryView){
+        _titleCategoryView = [[JXCategoryTitleView alloc] init];
+        _titleCategoryView.delegate = self;
+    }
+    return _titleCategoryView;
+}
+
+- (UIView *)titleBgView{
+    if(!_titleBgView){
+        _titleBgView = [[UIView alloc] init];
+        _titleBgView.backgroundColor = [MOTools colorWithHexString:@"#000000" alpha:0.05];
+    }
+    return _titleBgView;
+}
+
+
 @end

+ 1 - 1
MiMoLive/MiMoLive/Classes/Explore/View/PkRankListView/MOPkRankListView.xib

@@ -13,7 +13,7 @@
             <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
             <subviews>
-                <stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ErB-ux-e6g">
+                <stackView hidden="YES" opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="10" translatesAutoresizingMaskIntoConstraints="NO" id="ErB-ux-e6g">
                     <rect key="frame" x="50" y="10" width="293" height="30"/>
                     <subviews>
                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AYa-aS-FSN">

+ 8 - 1
MiMoLive/MiMoLive/Classes/Live/View/MOPkRankListView/MOLivePkRankListView.m

@@ -32,9 +32,16 @@
 - (void)awakeFromNib{
     [super awakeFromNib];
     
+    [self.titleLab setFont:[MOTextTools getTheFontWithSize:16.0 AndFontName:@"Gilroy"]];
+    
+    //上方 两个圆角
+    self.bgView.layer.cornerRadius = 16.0;
+    self.bgView.layer.masksToBounds = YES;
+    self.bgView.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
+    
     [self.bgView addSubview:self.mainView];
     [self.mainView mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(self.bgView).offset(67.0);
+        make.top.equalTo(self.bgView).offset(50.0);
         make.left.right.bottom.equalTo(self.bgView);
     }];
     

+ 9 - 17
MiMoLive/MiMoLive/Classes/Live/View/MOPkRankListView/MOLivePkRankListView.xib

@@ -16,10 +16,7 @@
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Wff-vG-Peg">
                     <rect key="frame" x="0.0" y="350" width="393" height="502"/>
                     <subviews>
-                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_pk_rank_bg" translatesAutoresizingMaskIntoConstraints="NO" id="JrF-l7-r5R">
-                            <rect key="frame" x="0.0" y="0.0" width="393" height="502"/>
-                        </imageView>
-                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sk2-L4-Btu">
+                        <view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Sk2-L4-Btu">
                             <rect key="frame" x="0.0" y="50" width="393" height="1"/>
                             <color key="backgroundColor" red="0.34509803921568627" green="0.19215686274509802" blue="0.52941176470588236" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <constraints>
@@ -27,37 +24,33 @@
                             </constraints>
                         </view>
                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="PK List" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JLQ-pS-FiS">
-                            <rect key="frame" x="19" y="15" width="53" height="21"/>
-                            <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                            <color key="textColor" red="0.49019607843137253" green="0.42745098039215684" blue="0.55686274509803924" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <rect key="frame" x="166.33333333333334" y="15" width="60.666666666666657" height="24"/>
+                            <fontDescription key="fontDescription" type="system" pointSize="20"/>
+                            <color key="textColor" red="0.15686274509803921" green="0.15686274509803921" blue="0.15686274509803921" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                             <nil key="highlightedColor"/>
                         </label>
                         <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Awk-Qb-yrp" customClass="BigBtn">
-                            <rect key="frame" x="355" y="15" width="21" height="21"/>
+                            <rect key="frame" x="355" y="16.666666666666686" width="21" height="21"/>
                             <constraints>
                                 <constraint firstAttribute="width" constant="21" id="RZG-NT-qde"/>
                                 <constraint firstAttribute="height" constant="21" id="yeV-ka-Jra"/>
                             </constraints>
                             <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
-                            <state key="normal" backgroundImage="icon_gary_wen"/>
+                            <state key="normal" backgroundImage="icon_black_wen"/>
                             <connections>
                                 <action selector="showRewardView:" destination="iN0-l3-epB" eventType="touchUpInside" id="i3J-u7-n2R"/>
                             </connections>
                         </button>
                     </subviews>
-                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <color key="backgroundColor" red="0.98431372549019602" green="0.97254901960784312" blue="0.97254901960784312" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                     <constraints>
                         <constraint firstAttribute="trailing" secondItem="Sk2-L4-Btu" secondAttribute="trailing" id="1we-6F-5my"/>
                         <constraint firstItem="Awk-Qb-yrp" firstAttribute="centerY" secondItem="JLQ-pS-FiS" secondAttribute="centerY" id="6w4-pX-7RB"/>
-                        <constraint firstItem="JLQ-pS-FiS" firstAttribute="leading" secondItem="Wff-vG-Peg" secondAttribute="leading" constant="19" id="GH4-Ns-cZk"/>
-                        <constraint firstAttribute="bottom" secondItem="JrF-l7-r5R" secondAttribute="bottom" id="Jgm-xO-FRt"/>
+                        <constraint firstItem="JLQ-pS-FiS" firstAttribute="centerX" secondItem="Wff-vG-Peg" secondAttribute="centerX" id="9D6-P7-DWy"/>
                         <constraint firstAttribute="trailing" secondItem="Awk-Qb-yrp" secondAttribute="trailing" constant="17" id="d0D-2S-6CL"/>
-                        <constraint firstItem="JrF-l7-r5R" firstAttribute="top" secondItem="Wff-vG-Peg" secondAttribute="top" id="eFf-7Y-0Uq"/>
                         <constraint firstItem="JLQ-pS-FiS" firstAttribute="top" secondItem="Wff-vG-Peg" secondAttribute="top" constant="15" id="hdq-Gf-Pkj"/>
                         <constraint firstAttribute="height" constant="502" id="kh2-mn-yac"/>
-                        <constraint firstItem="JrF-l7-r5R" firstAttribute="leading" secondItem="Wff-vG-Peg" secondAttribute="leading" id="s5i-CV-8Vk"/>
                         <constraint firstItem="Sk2-L4-Btu" firstAttribute="leading" secondItem="Wff-vG-Peg" secondAttribute="leading" id="uqZ-PT-cTo"/>
-                        <constraint firstAttribute="trailing" secondItem="JrF-l7-r5R" secondAttribute="trailing" id="vOa-Qz-mhW"/>
                         <constraint firstItem="Sk2-L4-Btu" firstAttribute="top" secondItem="Wff-vG-Peg" secondAttribute="top" constant="50" id="wIw-a4-eXs"/>
                     </constraints>
                 </view>
@@ -89,7 +82,6 @@
         </view>
     </objects>
     <resources>
-        <image name="icon_gary_wen" width="17" height="17"/>
-        <image name="icon_pk_rank_bg" width="375" height="553.33331298828125"/>
+        <image name="icon_black_wen" width="19.333333969116211" height="19.333333969116211"/>
     </resources>
 </document>

+ 1 - 1
MiMoLive/MiMoLive/Classes/Live/View/MOPkRankListView/MOLivePkRewardCell.xib

@@ -106,6 +106,6 @@
         </tableViewCell>
     </objects>
     <resources>
-        <image name="icon_half_hour_one" width="20" height="22"/>
+        <image name="icon_half_hour_one" width="19.333333969116211" height="21"/>
     </resources>
 </document>