Просмотр исходного кода

- 확인버튼만 있는 Popup에서 버튼크기가 작게 보이는 현상 수정

TaeHyun 8 лет назад
Родитель
Сommit
65b0976be9

+ 1 - 0
OneCable/Classes/CustomUI/CustomAlertView.h

@@ -44,6 +44,7 @@ typedef void(^CustomAlertViewCallBackHandler)(CustomAlertView *alertView, NSInte
 
 @property (weak, nonatomic) IBOutlet CustomButton *btnConfirm;
 @property (weak, nonatomic) IBOutlet CustomButton *btnCancel;
+@property (weak, nonatomic) IBOutlet CustomButton *btnConfirmSingle;
 
 @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSameWidth;
 @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnConfirmWidth;

+ 16 - 0
OneCable/Classes/CustomUI/CustomAlertView.m

@@ -53,14 +53,24 @@ static NSString *CustomAlertViewHandlerRunTimeAccosiationKey = @"CustomAlertView
     [_btnConfirm setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_right"] forState:UIControlStateNormal capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
     [_btnConfirm setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_right_press"] forState:UIControlStateHighlighted capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
     
+    [_btnConfirmSingle setBackgroundImage:[UIImage imageNamed:@"img_popup_btn"] forState:UIControlStateNormal capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
+    [_btnConfirmSingle setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_press"] forState:UIControlStateHighlighted capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
+    
     [_btnConfirm setTitle:okButtonTitle forState:UIControlStateNormal];
     
+    [_btnConfirmSingle setHidden:YES];
+    [_btnConfirm setHidden:NO];
+    [_btnCancel setHidden:NO];
     if (_cancelButtonTitle && ![_cancelButtonTitle isEmptyString]) {
 
         [_btnCancel setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_left"] forState:UIControlStateNormal capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
         [_btnCancel setBackgroundImage:[UIImage imageNamed:@"img_popup_btn_left_press"] forState:UIControlStateHighlighted capInsets:UIEdgeInsetsMake(kfTopInset,kfRightInset,kfBottomInset,kfLeftInset)];
         
         [_btnCancel setTitle:_cancelButtonTitle forState:UIControlStateNormal];
+    }else{
+        [_btnConfirmSingle setHidden:NO];
+        [_btnConfirm setHidden:YES];
+        [_btnCancel setHidden:YES];
     }
     
     return self;
@@ -95,6 +105,12 @@ static NSString *CustomAlertViewHandlerRunTimeAccosiationKey = @"CustomAlertView
     [self hide];
 }
 
+- (IBAction)btnConfirmSingleTouched:(id)sender {
+    
+    [self alertView:self clickedButtonAtIndex:0];
+    [self hide];
+}
+
 - (IBAction)btnCancelTouched:(id)sender {
 
     [self alertView:self clickedButtonAtIndex:1];

+ 61 - 66
OneCable/Classes/CustomUI/CustomAlertView.xib

@@ -30,7 +30,7 @@
                     </constraints>
                 </view>
                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="tQz-M2-lwq" userLabel="popUpView">
-                    <rect key="frame" x="24" y="185.5" width="272" height="197"/>
+                    <rect key="frame" x="24" y="186" width="272" height="197"/>
                     <subviews>
                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fhZ-ni-XDv" userLabel="ContainerView">
                             <rect key="frame" x="0.0" y="0.0" width="272" height="192"/>
@@ -199,81 +199,74 @@
                                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3Kp-Aa-8hu" userLabel="View - Container">
                                     <rect key="frame" x="0.0" y="149" width="272" height="43"/>
                                     <subviews>
-                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uh4-YE-hsU">
+                                        <button opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="136" placeholderIntrinsicHeight="43" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y8w-yV-bkf" customClass="CustomButton">
                                             <rect key="frame" x="136" y="0.0" width="136" height="43"/>
-                                            <subviews>
-                                                <button opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="140" placeholderIntrinsicHeight="43" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="y8w-yV-bkf" customClass="CustomButton">
-                                                    <rect key="frame" x="0.0" y="0.0" width="136" height="43"/>
-                                                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
-                                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
-                                                    <state key="normal" title="예" backgroundImage="img_popup_btn_right">
-                                                        <color key="titleColor" red="0.011764705882352941" green="0.60392156862745094" blue="0.87450980392156863" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                                        <color key="titleShadowColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                                    </state>
-                                                    <connections>
-                                                        <action selector="btnConfirmTouched:" destination="Hfs-b7-Ddf" eventType="touchUpInside" id="ftj-cb-RK0"/>
-                                                    </connections>
-                                                </button>
-                                            </subviews>
                                             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
-                                            <constraints>
-                                                <constraint firstAttribute="bottom" secondItem="y8w-yV-bkf" secondAttribute="bottom" id="Rc9-2U-MWk"/>
-                                                <constraint firstAttribute="trailing" secondItem="y8w-yV-bkf" secondAttribute="trailing" id="g6b-Ce-REG"/>
-                                                <constraint firstItem="y8w-yV-bkf" firstAttribute="leading" secondItem="uh4-YE-hsU" secondAttribute="leading" id="mW9-Q6-wLe"/>
-                                                <constraint firstItem="y8w-yV-bkf" firstAttribute="top" secondItem="uh4-YE-hsU" secondAttribute="top" id="zIU-cV-oII"/>
-                                            </constraints>
-                                        </view>
-                                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Icf-lL-2gk">
+                                            <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
+                                            <state key="normal" title="예" backgroundImage="img_popup_btn_right">
+                                                <color key="titleColor" red="0.011764705882352941" green="0.60392156862745094" blue="0.87450980392156863" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                <color key="titleShadowColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            </state>
+                                            <connections>
+                                                <action selector="btnConfirmTouched:" destination="Hfs-b7-Ddf" eventType="touchUpInside" id="ftj-cb-RK0"/>
+                                            </connections>
+                                        </button>
+                                        <button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="749" placeholderIntrinsicWidth="136" placeholderIntrinsicHeight="43" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ANL-3C-8HP" customClass="CustomButton">
                                             <rect key="frame" x="0.0" y="0.0" width="136" height="43"/>
-                                            <subviews>
-                                                <button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="749" placeholderIntrinsicWidth="140" placeholderIntrinsicHeight="43" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ANL-3C-8HP" customClass="CustomButton">
-                                                    <rect key="frame" x="0.0" y="0.0" width="136" height="43"/>
-                                                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="44" id="2Go-Li-2Ye">
-                                                            <variation key="heightClass=regular-widthClass=compact" constant="50"/>
-                                                        </constraint>
-                                                    </constraints>
-                                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
-                                                    <state key="normal" title="아니오" backgroundImage="img_popup_btn_left">
-                                                        <color key="titleColor" red="0.53333333333333333" green="0.5607843137254902" blue="0.6588235294117647" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                                        <color key="titleShadowColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                                    </state>
-                                                    <variation key="default">
-                                                        <mask key="constraints">
-                                                            <exclude reference="2Go-Li-2Ye"/>
-                                                        </mask>
-                                                    </variation>
-                                                    <variation key="heightClass=regular-widthClass=compact">
-                                                        <mask key="constraints">
-                                                            <exclude reference="2Go-Li-2Ye"/>
-                                                        </mask>
-                                                    </variation>
-                                                    <connections>
-                                                        <action selector="btnCancelTouched:" destination="Hfs-b7-Ddf" eventType="touchUpInside" id="D4Z-8d-G9E"/>
-                                                    </connections>
-                                                </button>
-                                            </subviews>
                                             <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                             <constraints>
-                                                <constraint firstAttribute="bottom" secondItem="ANL-3C-8HP" secondAttribute="bottom" id="PXx-Q6-DJK"/>
-                                                <constraint firstItem="ANL-3C-8HP" firstAttribute="leading" secondItem="Icf-lL-2gk" secondAttribute="leading" id="af9-D7-QHM"/>
-                                                <constraint firstItem="ANL-3C-8HP" firstAttribute="top" secondItem="Icf-lL-2gk" secondAttribute="top" id="qtm-9o-A2U"/>
-                                                <constraint firstAttribute="trailing" secondItem="ANL-3C-8HP" secondAttribute="trailing" id="xW5-Uz-wiO"/>
+                                                <constraint firstAttribute="height" constant="44" id="2Go-Li-2Ye">
+                                                    <variation key="heightClass=regular-widthClass=compact" constant="50"/>
+                                                </constraint>
                                             </constraints>
-                                        </view>
+                                            <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
+                                            <state key="normal" title="아니오" backgroundImage="img_popup_btn_left">
+                                                <color key="titleColor" red="0.53333333333333333" green="0.5607843137254902" blue="0.6588235294117647" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                <color key="titleShadowColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            </state>
+                                            <variation key="default">
+                                                <mask key="constraints">
+                                                    <exclude reference="2Go-Li-2Ye"/>
+                                                </mask>
+                                            </variation>
+                                            <variation key="heightClass=regular-widthClass=compact">
+                                                <mask key="constraints">
+                                                    <exclude reference="2Go-Li-2Ye"/>
+                                                </mask>
+                                            </variation>
+                                            <connections>
+                                                <action selector="btnCancelTouched:" destination="Hfs-b7-Ddf" eventType="touchUpInside" id="D4Z-8d-G9E"/>
+                                            </connections>
+                                        </button>
+                                        <button opaque="NO" contentMode="scaleToFill" placeholderIntrinsicWidth="136" placeholderIntrinsicHeight="43" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QEu-MJ-xn4" customClass="CustomButton">
+                                            <rect key="frame" x="0.0" y="0.0" width="272" height="43"/>
+                                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+                                            <fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
+                                            <state key="normal" title="확인" backgroundImage="img_popup_btn">
+                                                <color key="titleColor" red="0.01176470588" green="0.60392156860000001" blue="0.87450980389999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                <color key="titleShadowColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                            </state>
+                                            <connections>
+                                                <action selector="btnConfirmSingleTouched:" destination="Hfs-b7-Ddf" eventType="touchUpInside" id="StF-N0-80g"/>
+                                                <action selector="btnConfirmTouched:" destination="Hfs-b7-Ddf" eventType="touchUpInside" id="Gnv-6n-Oqg"/>
+                                            </connections>
+                                        </button>
                                     </subviews>
                                     <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="43" id="09O-dh-FeX"/>
-                                        <constraint firstItem="uh4-YE-hsU" firstAttribute="top" secondItem="3Kp-Aa-8hu" secondAttribute="top" id="9TR-ay-XBf"/>
-                                        <constraint firstAttribute="bottom" secondItem="Icf-lL-2gk" secondAttribute="bottom" id="SGc-Tc-qwd"/>
-                                        <constraint firstAttribute="bottom" secondItem="uh4-YE-hsU" secondAttribute="bottom" id="ZiH-bQ-Q0m"/>
-                                        <constraint firstAttribute="trailing" secondItem="uh4-YE-hsU" secondAttribute="trailing" id="aQk-e0-F46"/>
-                                        <constraint firstItem="uh4-YE-hsU" firstAttribute="width" secondItem="Icf-lL-2gk" secondAttribute="width" id="f0Z-aP-ui4"/>
-                                        <constraint firstItem="Icf-lL-2gk" firstAttribute="leading" secondItem="3Kp-Aa-8hu" secondAttribute="leading" id="ou1-mW-dTE"/>
-                                        <constraint firstItem="Icf-lL-2gk" firstAttribute="top" secondItem="3Kp-Aa-8hu" secondAttribute="top" id="vQA-cs-tcc"/>
-                                        <constraint firstItem="uh4-YE-hsU" firstAttribute="leading" secondItem="Icf-lL-2gk" secondAttribute="trailing" id="wZ4-rf-8ES"/>
+                                        <constraint firstItem="y8w-yV-bkf" firstAttribute="top" secondItem="3Kp-Aa-8hu" secondAttribute="top" id="35P-II-qZO"/>
+                                        <constraint firstAttribute="bottom" secondItem="ANL-3C-8HP" secondAttribute="bottom" id="7ZG-9g-FIc"/>
+                                        <constraint firstItem="y8w-yV-bkf" firstAttribute="leading" secondItem="ANL-3C-8HP" secondAttribute="trailing" id="Aya-8z-VFm"/>
+                                        <constraint firstItem="ANL-3C-8HP" firstAttribute="leading" secondItem="3Kp-Aa-8hu" secondAttribute="leading" id="EYu-Kl-zMs"/>
+                                        <constraint firstItem="QEu-MJ-xn4" firstAttribute="leading" secondItem="3Kp-Aa-8hu" secondAttribute="leading" id="GVe-FD-fb9"/>
+                                        <constraint firstAttribute="trailing" secondItem="y8w-yV-bkf" secondAttribute="trailing" id="J0K-X1-H5I"/>
+                                        <constraint firstAttribute="bottom" secondItem="QEu-MJ-xn4" secondAttribute="bottom" id="L9A-vM-cWz"/>
+                                        <constraint firstAttribute="trailing" secondItem="QEu-MJ-xn4" secondAttribute="trailing" id="QA9-7A-sTD"/>
+                                        <constraint firstItem="QEu-MJ-xn4" firstAttribute="top" secondItem="3Kp-Aa-8hu" secondAttribute="top" id="dpZ-Mx-eWW"/>
+                                        <constraint firstItem="ANL-3C-8HP" firstAttribute="width" secondItem="y8w-yV-bkf" secondAttribute="width" id="mc8-LJ-dsz"/>
+                                        <constraint firstAttribute="bottom" secondItem="y8w-yV-bkf" secondAttribute="bottom" id="rgA-Uq-A59"/>
+                                        <constraint firstItem="ANL-3C-8HP" firstAttribute="top" secondItem="3Kp-Aa-8hu" secondAttribute="top" id="zz8-fC-5Mf"/>
                                     </constraints>
                                 </view>
                             </subviews>
@@ -437,6 +430,7 @@
             <connections>
                 <outlet property="btnCancel" destination="ANL-3C-8HP" id="Aq5-T6-elO"/>
                 <outlet property="btnConfirm" destination="y8w-yV-bkf" id="SZW-na-pCG"/>
+                <outlet property="btnConfirmSingle" destination="QEu-MJ-xn4" id="P01-2Y-Ky1"/>
                 <outlet property="containerView" destination="fhZ-ni-XDv" id="tB8-2s-UbC"/>
                 <outlet property="imgTitleBar" destination="ypw-TE-5gz" id="vch-oy-GPA"/>
                 <outlet property="lblMessage1" destination="cbz-oh-9hL" id="fgf-Dz-ZYQ"/>
@@ -452,6 +446,7 @@
         <image name="common_bg_alpha_85" width="2" height="2"/>
         <image name="img_popup_bg_body" width="2" height="2"/>
         <image name="img_popup_bg_head" width="37" height="48"/>
+        <image name="img_popup_btn" width="37" height="34"/>
         <image name="img_popup_btn_left" width="37" height="34"/>
         <image name="img_popup_btn_right" width="37" height="34"/>
     </resources>