Преглед на файлове

- 홈허브 Disable UI적

KaRam Kim преди 8 години
родител
ревизия
fc9db52106

+ 1 - 1
OneCable/Classes/ViewControllers/ThingsScreens/HomeHubSelectPopupTableViewCell.xib

@@ -77,7 +77,7 @@
                         <state key="normal" image="common_radiobox_default" backgroundImage="common_radiobox_default">
                             <color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                         </state>
-                        <state key="disabled" backgroundImage="common_radiobox_disable"/>
+                        <state key="disabled" image="common_radiobox_disable" backgroundImage="common_radiobox_disable"/>
                         <state key="highlighted" image="common_radiobox_checked" backgroundImage="common_radiobox_checked"/>
                     </button>
                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U0f-mm-BoT">

+ 27 - 8
OneCable/Classes/ViewControllers/ThingsScreens/HomeHubSelectPopupView.m

@@ -127,14 +127,22 @@
     tcell.lbDesc.text = [NSString stringWithFormat:@"추가 가능한 장치 수량 %@", info.remainCtrtCnt];
     tcell.btnRadio.value = info;
     
+
+    
     if (indexPath.row == 0 && !_isNotFirstLoading) {
         _isNotFirstLoading = YES;
         tcell.btnRadio.checked = YES;
     } else {
-        NSLog(@"%@", BOOLToString([tcell.btnRadio getRadioStatusFromValue]));
+//        NSLog(@"%@", BOOLToString([tcell.btnRadio getRadioStatusFromValue]));
         tcell.btnRadio.checked = [tcell.btnRadio getRadioStatusFromValue];
     }
     
+    if ([info.remainCtrtCnt integerValue] < 1) {
+        tcell.btnRadio.enabled = NO;
+    }
+    
+    
+    
     [_rgroup addRadioButton:tcell.btnRadio];
     
     //set background image
@@ -143,12 +151,20 @@
 //    } else {
 //        tcell.backgroundView = [[UIImageView alloc] initWithImage:_bgCellImage2];
 //    }
-    
-    if (tcell.btnRadio.checked) {
-        tcell.backgroundView = [[UIImageView alloc] initWithImage:_bgCellImage1];
+    if (tcell.btnRadio.enabled) {
+        if (tcell.btnRadio.checked) {
+            tcell.backgroundView = [[UIImageView alloc] initWithImage:_bgCellImage1];
+        } else {
+            tcell.backgroundView = [[UIImageView alloc] initWithImage:_bgCellImage2];
+        }
     } else {
-        tcell.backgroundView = [[UIImageView alloc] initWithImage:_bgCellImage2];
+        tcell.backgroundView = [[UIImageView alloc] initWithImage:_bgCellImage3];
+        tcell.lbTitle.textColor = kUITextColor08;
+        tcell.lbSerial.textColor = kUITextColor08;
+        tcell.lbDesc.textColor = kUITextColor08;
+        
     }
+        
     
     return tcell;
 }
@@ -157,9 +173,12 @@
     [tableView deselectRowAtIndexPath:indexPath animated:YES];
     
     HomeHubSelectPopupTableViewCell *tcell = (HomeHubSelectPopupTableViewCell *)[self tableView:tableView cellForRowAtIndexPath:indexPath];
-    [_rgroup someRadioButtonTouched:tcell.btnRadio];
-    
-    [_tableView reloadData];
+    if (tcell.btnRadio.enabled) {
+        [_rgroup someRadioButtonTouched:tcell.btnRadio];
+        
+        [_tableView reloadData];
+    }
+
 }