Explorar o código

2017.07.14 팝업 레이아웃 수정

eunmi.kim %!s(int64=8) %!d(string=hai) anos
pai
achega
443e450867

+ 11 - 5
OneCable/Classes/CommonUI/CommandClassControlNodeView.m

@@ -22,7 +22,7 @@
 #define kfCommandNodeSwitchRightPadding    0.0f
 #define kfCommandNodeLockRightPadding      0.0f
 
-#define kfControlNodeDefaultWidth               256.0f
+#define kfControlNodeDefaultWidth               [UIScreen mainScreen].bounds.size.width - 100//256.0f
 //#define kfControlMaxWidth                   IPHONE_WIDTH - 105.0f
 #define kfControlNodeDefaultHeight              36.0f
 #define kfControlNodeDefaultMargin              0.0f
@@ -34,13 +34,14 @@
     
     for (UIView *view in [CommonUtil nibViews:@"CommandClassControlNodeView"]) {
         if (view.tag == cmdClsType) {
-            
-            NSLog(@"cmdClsType : %d", cmdClsType);
-            
+
             controlView = (CommandClassControlNodeView *)view;
             controlView.width = kfControlNodeDefaultWidth;
             controlView.height = kfControlNodeDefaultHeight;
             
+            NSLog(@"controlView : %f ", controlView.frame.size.width);
+            
+            
             break;
         }
     }
@@ -139,12 +140,15 @@
     }
     
     if (_nodeEnable) {
+        
         if ([_subItem.cmdclsValue isEqualToString:cmdclsValueOn.cmdclsValue]) {
             [self btnOpenTouched:nil];
         } else {
             [self btnCloseTouched:nil];
         }
+        
     } else {
+        
         _btnOpen.selected = NO;
         _btnClose.selected = NO;
         
@@ -221,8 +225,9 @@
     
     CGFloat eWidth = width + kfCommandNodeSwitchLeftPadding + kfCommandNodeSwitchRightPadding;
     _constraintBtnOnWidth.constant = eWidth;
-    NSLog(@"SubItem : %@", _subItem.cmdclsValueList);
+     
     if (_subItem.cmdclsValueList.count) {
+        
         CmdClsValueModel *cmdclsValueOn = _subItem.cmdclsValueList[0];
         CmdClsValueModel *cmdclsValueOff = _subItem.cmdclsValueList[1];
         
@@ -238,6 +243,7 @@
             } else {
                 [self btnOffTouched:nil];
             }
+            
         } else {
             _btnOn.selected = NO;
             _btnOff.selected = NO;

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 516 - 513
OneCable/Classes/CommonUI/CommandClassControlNodeView.xib


+ 1 - 1
OneCable/Classes/CommonUI/DeviceNodePopupTableViewCell.xib

@@ -14,7 +14,7 @@
             <rect key="frame" x="0.0" y="0.0" width="320" height="130"/>
             <autoresizingMask key="autoresizingMask"/>
             <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="iyt-NC-2Eb" id="aYc-Bf-Bll">
-                <rect key="frame" x="0.0" y="0.0" width="320" height="129.5"/>
+                <rect key="frame" x="0.0" y="0.0" width="320" height="130"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="common_bg_list_02" translatesAutoresizingMaskIntoConstraints="NO" id="7GN-eM-ZPr">

+ 10 - 9
OneCable/Classes/CommonUI/DeviceNodePopupView.m

@@ -114,7 +114,7 @@
     
     _refDevice = refDevice;
     
-    NSLog(@"refDevice : %@", refDevice);
+    //NSLog(@"refDevice : %@", refDevice);
     
     self.lblTitle.text = _refDevice.sourceName;
     //    [self.imgvDevice sd_setImageWithURL:[NSURL URLWithString:_refDevice.imageFileName] placeholderImage:nil options:SDWebImageRefreshCached];
@@ -168,8 +168,6 @@
     
     tcell.lblNodeName.text = subItem.sourceSubName;
     
-    //1.set node
-    
     //뷰를 초기화함.
     [[tcell.controlContainer subviews] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
         UIView *subview = (UIView *)obj;
@@ -230,14 +228,17 @@
     tcell.controlContainer.hidden = !controlView;
     
     if (!tcell.controlContainer.hidden) {
+        
         UIView *superview = tcell.controlContainer;
         [superview addSubview:controlView];
-        [controlView mas_makeConstraints:^(MASConstraintMaker *make) {
-
-            make.size.mas_equalTo(controlView.frame.size);
-            make.left.equalTo(superview);
-            make.top.equalTo(superview);
-        }];
+        [controlView fillToSuperView];
+        
+//        [controlView mas_makeConstraints:^(MASConstraintMaker *make) {
+//
+//            make.size.mas_equalTo(controlView.frame.size);
+//            make.left.equalTo(superview);
+//            make.top.equalTo(superview);
+//        }];
     }