Radio button in iPhone app

后端 未结 11 1747
臣服心动
臣服心动 2020-12-06 06:11

I have to add radio buttons in my iPhone application. For that I have got radio button image which is of round in shape. Can I add that image as a subview? and Can I add tou

11条回答
  •  暖寄归人
    2020-12-06 06:38

    IBOutlet UIButton *checkboxButtonMale; 
    
    IBOutlet UIButton    *checkboxButtonFmale;
    
      checkboxButtonFmale.tag = 3;
      checkboxButtonMale.tag = 2; 
    
    (IBAction)checkboxGenderChecked:(id)sender{ 
    
    
        UIButton *selectedButton = (UIButton *)sender;
        UIButton    *toggledButton; 
    
        if (selectedButton.tag == 2 ) { 
            toggledButton =    checkboxButtonFmale;
        } 
        else {      
            toggledButton = checkboxButtonMale; 
        }   [toggledButton    setSelected:NO]; 
        [sender setSelected:YES];
           }
    

提交回复
热议问题