Stop interaction in IOS-UIView
UIView stop interaction (no focus ):
Set userInteractionEnabled = NO to get the interaction settings YES.
It can be applied to custom controls such as UIButton and UITextField.
[editButton setUserInteractionEnabled:YES];editButton.userInteractionEnabled = NO;
Instance:
# Pragma mark ItemChooseViewDelegate // select the service type Box-(void) didSelectedItem {NIDPRINTMETHODNAME (); _ servicePos = _ serviceItemListView. selectedIndex; // set the Item location // total Price _ totalPrice = (float) ([_ goodsList [_ servicePos] [@ Price] floatValue]/100.0) * [[_ serviceNumList objectAtIndex: _ servicePos] integerValue]; [_ totalPriceLabel setText: [NSString stringWithFormat: @ % 0.1f, _ totalPrice]; // set the button status for (int I = 0; I <_ goodsList. count; ++ I) {// select if (I = _ servicePos) {[[_ titleLabelArray objectAtIndex: I] setTextColor: [UIColor blackColor]; [[_ priceLabelArray objectAtIndex: I] setTextColor: RGBCOLOR_HEX (0xff6000)]; [[_ timesFieldArray objectAtIndex: I] setTextColor: [UIColor blackColor]; [_ timesFieldArray objectAtIndex: i] setUserInteractionEnabled: YES]; [[_ addBtnArray objectAtIndex: I] setUserInteractionEnabled: YES]; [[_ subBtnArray objectAtIndex: I] setUserInteractionEnabled: YES]; continue ;} // [_ titleLabelArray objectAtIndex: I] setTextColor: [UIColor grayColor]; [_ priceLabelArray objectAtIndex: I] setTextColor: [UIColor grayColor] is not selected; [[_ timesFieldArray objectAtIndex: I] setTextColor: [UIColor grayColor]; [_ timesFieldArray objectAtIndex: I] setUserInteractionEnabled: NO]; [_ addBtnArray objectAtIndex: I] identifier: NO]; [[_ subBtnArray objectAtIndex: I] setUserInteractionEnabled: NO];}