Browse Source

部分按钮的高亮状态

Steven 5 years ago
parent
commit
fc4db90ded

+ 28 - 0
MusicGradeExam/MusicGradeExam/Assets.xcassets/buttonStatus/button_highlight.imageset/Contents.json

@@ -7,11 +7,39 @@
     {
       "filename" : "button_highlight@2x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 49,
+          "left" : 48,
+          "right" : 48,
+          "top" : 48
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "2x"
     },
     {
       "filename" : "button_highlight@3x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 73,
+          "left" : 73,
+          "right" : 73,
+          "top" : 73
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "3x"
     }
   ],

+ 28 - 0
MusicGradeExam/MusicGradeExam/Assets.xcassets/buttonStatus/button_nomal.imageset/Contents.json

@@ -7,11 +7,39 @@
     {
       "filename" : "button_nomal@2x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 49,
+          "left" : 49,
+          "right" : 49,
+          "top" : 48
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "2x"
     },
     {
       "filename" : "button_nomal@3x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 73,
+          "left" : 73,
+          "right" : 73,
+          "top" : 73
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "3x"
     }
   ],

+ 28 - 0
MusicGradeExam/MusicGradeExam/Assets.xcassets/buttonStatus/button_unable.imageset/Contents.json

@@ -7,11 +7,39 @@
     {
       "filename" : "button_unable@2x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 49,
+          "left" : 49,
+          "right" : 49,
+          "top" : 48
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "2x"
     },
     {
       "filename" : "button_unable@3x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 73,
+          "left" : 73,
+          "right" : 73,
+          "top" : 73
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "3x"
     }
   ],

+ 28 - 0
MusicGradeExam/MusicGradeExam/Assets.xcassets/buttonStatus/layer_buttonHighlight.imageset/Contents.json

@@ -7,11 +7,39 @@
     {
       "filename" : "layer_buttonHighlight@2x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 49,
+          "left" : 49,
+          "right" : 49,
+          "top" : 48
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "2x"
     },
     {
       "filename" : "layer_buttonHighlight@3x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 73,
+          "left" : 73,
+          "right" : 73,
+          "top" : 73
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "3x"
     }
   ],

+ 28 - 0
MusicGradeExam/MusicGradeExam/Assets.xcassets/buttonStatus/layer_buttonNomal.imageset/Contents.json

@@ -7,11 +7,39 @@
     {
       "filename" : "layer_buttonNomal@2x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 49,
+          "left" : 49,
+          "right" : 49,
+          "top" : 48
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "2x"
     },
     {
       "filename" : "layer_buttonNomal@3x.png",
       "idiom" : "universal",
+      "resizing" : {
+        "cap-insets" : {
+          "bottom" : 73,
+          "left" : 73,
+          "right" : 73,
+          "top" : 73
+        },
+        "center" : {
+          "height" : 1,
+          "mode" : "tile",
+          "width" : 1
+        },
+        "mode" : "9-part"
+      },
       "scale" : "3x"
     }
   ],

+ 6 - 0
MusicGradeExam/MusicGradeExam/UI/Exam/View/ExamDeviceCheckView.m

@@ -60,6 +60,12 @@
 - (void)awakeFromNib {
     [super awakeFromNib];
     [self resetView];
+    [self.oneButton setBackgroundImage:[UIImage imageNamed:@"button_nomal"] forState:UIControlStateNormal];
+    [self.oneButton setBackgroundImage:[UIImage imageNamed:@"button_highlight"] forState:UIControlStateHighlighted];
+    [self.twoPreButton setBackgroundImage:[UIImage imageNamed:@"layer_buttonNomal"] forState:UIControlStateNormal];
+    [self.twoPreButton setBackgroundImage:[UIImage imageNamed:@"layer_buttonHighlight"] forState:UIControlStateHighlighted];
+    [self.twoNextButton setBackgroundImage:[UIImage imageNamed:@"button_nomal"] forState:UIControlStateNormal];
+    [self.twoNextButton setBackgroundImage:[UIImage imageNamed:@"button_highlight"] forState:UIControlStateHighlighted];
 }
 
 - (void)resetView {

+ 16 - 32
MusicGradeExam/MusicGradeExam/UI/Exam/View/ExamDeviceCheckView.xib

@@ -164,16 +164,15 @@
                             </constraints>
                         </view>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ehX-MZ-qgf">
-                            <rect key="frame" x="0.0" y="277" width="414" height="45"/>
+                            <rect key="frame" x="0.0" y="277" width="414" height="50"/>
                             <subviews>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0AR-Ph-gQG">
-                                    <rect key="frame" x="60" y="0.0" width="294" height="45"/>
-                                    <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
+                                    <rect key="frame" x="60" y="0.0" width="294" height="50"/>
                                     <constraints>
-                                        <constraint firstAttribute="height" constant="45" id="NXb-CR-6yc"/>
+                                        <constraint firstAttribute="height" constant="50" id="NXb-CR-6yc"/>
                                     </constraints>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
-                                    <state key="normal" title="开始测试"/>
+                                    <state key="normal" title="开始测试" backgroundImage="button_nomal"/>
                                     <userDefinedRuntimeAttributes>
                                         <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
                                             <real key="value" value="20"/>
@@ -189,43 +188,26 @@
                                 <constraint firstItem="0AR-Ph-gQG" firstAttribute="top" secondItem="ehX-MZ-qgf" secondAttribute="top" id="G2U-pO-2xy"/>
                                 <constraint firstItem="0AR-Ph-gQG" firstAttribute="leading" secondItem="ehX-MZ-qgf" secondAttribute="leading" constant="60" id="Ww0-Yy-5jj"/>
                                 <constraint firstAttribute="trailing" secondItem="0AR-Ph-gQG" secondAttribute="trailing" constant="60" id="ci1-us-zkX"/>
-                                <constraint firstAttribute="height" constant="45" id="uN5-h8-yA5"/>
+                                <constraint firstAttribute="height" constant="50" id="uN5-h8-yA5"/>
                             </constraints>
                         </view>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Qn1-ek-Ma0">
-                            <rect key="frame" x="0.0" y="277" width="414" height="45"/>
+                            <rect key="frame" x="0.0" y="277" width="414" height="50"/>
                             <subviews>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="193-DS-VAC">
-                                    <rect key="frame" x="219" y="0.0" width="167" height="45"/>
-                                    <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
+                                    <rect key="frame" x="219" y="0.0" width="167" height="50"/>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
-                                    <state key="normal" title="有声音"/>
-                                    <userDefinedRuntimeAttributes>
-                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                            <real key="value" value="22.5"/>
-                                        </userDefinedRuntimeAttribute>
-                                    </userDefinedRuntimeAttributes>
+                                    <state key="normal" title="有声音" backgroundImage="button_nomal"/>
                                     <connections>
                                         <action selector="nextAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="i3c-xA-jON"/>
                                     </connections>
                                 </button>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5RC-yu-zq4">
-                                    <rect key="frame" x="28" y="0.0" width="167" height="45"/>
+                                    <rect key="frame" x="28" y="0.0" width="167" height="50"/>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
-                                    <state key="normal" title="无声音">
+                                    <state key="normal" title="无声音" backgroundImage="layer_buttonNomal">
                                         <color key="titleColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     </state>
-                                    <userDefinedRuntimeAttributes>
-                                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
-                                            <real key="value" value="1"/>
-                                        </userDefinedRuntimeAttribute>
-                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                            <real key="value" value="22.5"/>
-                                        </userDefinedRuntimeAttribute>
-                                        <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
-                                            <color key="value" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                        </userDefinedRuntimeAttribute>
-                                    </userDefinedRuntimeAttributes>
                                     <connections>
                                         <action selector="preAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="Ivu-R5-fuO"/>
                                     </connections>
@@ -237,7 +219,7 @@
                                 <constraint firstAttribute="bottom" secondItem="193-DS-VAC" secondAttribute="bottom" id="9LV-am-TAJ"/>
                                 <constraint firstItem="5RC-yu-zq4" firstAttribute="leading" secondItem="Qn1-ek-Ma0" secondAttribute="leading" constant="28" id="OdM-91-L6e"/>
                                 <constraint firstAttribute="trailing" secondItem="193-DS-VAC" secondAttribute="trailing" constant="28" id="PSX-fV-TRi"/>
-                                <constraint firstAttribute="height" constant="45" id="bdg-Pr-aNI"/>
+                                <constraint firstAttribute="height" constant="50" id="bdg-Pr-aNI"/>
                                 <constraint firstItem="193-DS-VAC" firstAttribute="width" secondItem="5RC-yu-zq4" secondAttribute="width" id="cNl-6i-hrM"/>
                                 <constraint firstItem="193-DS-VAC" firstAttribute="top" secondItem="Qn1-ek-Ma0" secondAttribute="top" id="mV1-Qo-9M1"/>
                                 <constraint firstAttribute="bottom" secondItem="5RC-yu-zq4" secondAttribute="bottom" id="pod-Y5-2W0"/>
@@ -251,10 +233,10 @@
                         <constraint firstItem="s92-Mv-XRN" firstAttribute="centerX" secondItem="bc9-Kl-Ad2" secondAttribute="centerX" id="1Rh-Kt-fsO"/>
                         <constraint firstAttribute="height" constant="350" id="3JD-UY-eui"/>
                         <constraint firstItem="s92-Mv-XRN" firstAttribute="top" secondItem="9hS-C8-9oD" secondAttribute="bottom" constant="8" id="6dH-D2-1Cz"/>
-                        <constraint firstAttribute="bottom" secondItem="ehX-MZ-qgf" secondAttribute="bottom" constant="28" id="AFQ-9b-zAo"/>
+                        <constraint firstAttribute="bottom" secondItem="ehX-MZ-qgf" secondAttribute="bottom" constant="23" id="AFQ-9b-zAo"/>
                         <constraint firstAttribute="trailing" secondItem="7I2-EN-weU" secondAttribute="trailing" constant="72" id="HbJ-EG-T43"/>
                         <constraint firstItem="7I2-EN-weU" firstAttribute="centerX" secondItem="1tJ-pa-zNA" secondAttribute="centerX" id="R5m-xc-QFu"/>
-                        <constraint firstAttribute="bottom" secondItem="Qn1-ek-Ma0" secondAttribute="bottom" constant="28" id="WMD-HU-pO8"/>
+                        <constraint firstAttribute="bottom" secondItem="Qn1-ek-Ma0" secondAttribute="bottom" constant="23" id="WMD-HU-pO8"/>
                         <constraint firstItem="4gq-r8-hKI" firstAttribute="top" secondItem="7I2-EN-weU" secondAttribute="bottom" constant="5" id="cgx-Cw-AhF"/>
                         <constraint firstItem="7I2-EN-weU" firstAttribute="leading" secondItem="bc9-Kl-Ad2" secondAttribute="leading" constant="72" id="cyF-6h-LER"/>
                         <constraint firstItem="9hS-C8-9oD" firstAttribute="centerX" secondItem="bc9-Kl-Ad2" secondAttribute="centerX" id="dg2-jO-Mci"/>
@@ -306,13 +288,15 @@
                 <outlet property="twoNextButton" destination="193-DS-VAC" id="Xkd-OC-M6n"/>
                 <outlet property="twoPreButton" destination="5RC-yu-zq4" id="z8a-Hx-i1J"/>
             </connections>
-            <point key="canvasLocation" x="132" y="107"/>
+            <point key="canvasLocation" x="131.8840579710145" y="106.47321428571428"/>
         </view>
     </objects>
     <resources>
+        <image name="button_nomal" width="49.5" height="49"/>
         <image name="check_device" width="150" height="118"/>
         <image name="check_dotted" width="30" height="1"/>
         <image name="check_wait" width="16" height="16"/>
         <image name="checking" width="16" height="16"/>
+        <image name="layer_buttonNomal" width="49.5" height="49"/>
     </resources>
 </document>

+ 2 - 2
MusicGradeExam/MusicGradeExam/UI/Exam/View/WaitExamBodyView.xib

@@ -232,8 +232,8 @@
         </view>
     </objects>
     <resources>
-        <image name="button_unable" width="340" height="49"/>
-        <image name="layer_buttonNomal" width="340" height="49"/>
+        <image name="button_unable" width="49.5" height="49"/>
+        <image name="layer_buttonNomal" width="49.5" height="49"/>
         <image name="sign_noOpen" width="164" height="164"/>
     </resources>
 </document>

+ 6 - 0
MusicGradeExam/MusicGradeExam/UI/UserCenter/DeviceCheck/DeviceCheckView.m

@@ -59,6 +59,12 @@
 - (void)awakeFromNib {
     [super awakeFromNib];
     [self resetView];
+    [self.oneButton setBackgroundImage:[UIImage imageNamed:@"button_nomal"] forState:UIControlStateNormal];
+    [self.oneButton setBackgroundImage:[UIImage imageNamed:@"button_highlight"] forState:UIControlStateHighlighted];
+    [self.twoPreButton setBackgroundImage:[UIImage imageNamed:@"layer_buttonNomal"] forState:UIControlStateNormal];
+    [self.twoPreButton setBackgroundImage:[UIImage imageNamed:@"layer_buttonHighlight"] forState:UIControlStateHighlighted];
+    [self.twoNextButton setBackgroundImage:[UIImage imageNamed:@"button_nomal"] forState:UIControlStateNormal];
+    [self.twoNextButton setBackgroundImage:[UIImage imageNamed:@"button_highlight"] forState:UIControlStateHighlighted];
 }
 
 - (void)resetView {

+ 5 - 26
MusicGradeExam/MusicGradeExam/UI/UserCenter/DeviceCheck/DeviceCheckView.xib

@@ -164,17 +164,11 @@
                             <subviews>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AQ9-e9-PS8">
                                     <rect key="frame" x="60" y="0.0" width="200" height="45"/>
-                                    <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="45" id="mqD-6p-bqe"/>
                                     </constraints>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
-                                    <state key="normal" title="开始测试"/>
-                                    <userDefinedRuntimeAttributes>
-                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                            <real key="value" value="20"/>
-                                        </userDefinedRuntimeAttribute>
-                                    </userDefinedRuntimeAttributes>
+                                    <state key="normal" title="开始测试" backgroundImage="button_nomal"/>
                                     <connections>
                                         <action selector="oneButtonAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="deS-Is-P3L"/>
                                     </connections>
@@ -193,14 +187,8 @@
                             <subviews>
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="SPT-Hd-ERF">
                                     <rect key="frame" x="172" y="0.0" width="120" height="45"/>
-                                    <color key="backgroundColor" red="0.1764705882" green="0.78039215689999997" blue="0.66666666669999997" alpha="1" colorSpace="calibratedRGB"/>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
-                                    <state key="normal" title="有声音"/>
-                                    <userDefinedRuntimeAttributes>
-                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                            <real key="value" value="22.5"/>
-                                        </userDefinedRuntimeAttribute>
-                                    </userDefinedRuntimeAttributes>
+                                    <state key="normal" title="有声音" backgroundImage="button_nomal"/>
                                     <connections>
                                         <action selector="nextAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="DTr-YZ-umg"/>
                                     </connections>
@@ -208,20 +196,9 @@
                                 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3Vr-mf-Mbz">
                                     <rect key="frame" x="28" y="0.0" width="120" height="45"/>
                                     <fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
-                                    <state key="normal" title="无声音">
+                                    <state key="normal" title="无声音" backgroundImage="layer_buttonNomal">
                                         <color key="titleColor" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                     </state>
-                                    <userDefinedRuntimeAttributes>
-                                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
-                                            <real key="value" value="1"/>
-                                        </userDefinedRuntimeAttribute>
-                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
-                                            <real key="value" value="22.5"/>
-                                        </userDefinedRuntimeAttribute>
-                                        <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
-                                            <color key="value" red="0.1764705882352941" green="0.7803921568627451" blue="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                        </userDefinedRuntimeAttribute>
-                                    </userDefinedRuntimeAttributes>
                                     <connections>
                                         <action selector="preAction:" destination="iN0-l3-epB" eventType="touchUpInside" id="EeJ-9E-Fj6"/>
                                     </connections>
@@ -305,10 +282,12 @@
         </view>
     </objects>
     <resources>
+        <image name="button_nomal" width="49.5" height="49"/>
         <image name="check_cancle" width="14" height="14"/>
         <image name="check_device" width="150" height="118"/>
         <image name="check_dotted" width="30" height="1"/>
         <image name="check_wait" width="16" height="16"/>
         <image name="checking" width="16" height="16"/>
+        <image name="layer_buttonNomal" width="49.5" height="49"/>
     </resources>
 </document>

+ 1 - 1
MusicGradeExam/MusicGradeExam/UI/UserCenter/Setting/View/PhoneChangeBodyView.xib

@@ -102,6 +102,6 @@
         </view>
     </objects>
     <resources>
-        <image name="button_nomal" width="340" height="49"/>
+        <image name="button_nomal" width="49.5" height="49"/>
     </resources>
 </document>