Radio button in iPhone app

后端 未结 11 1760
臣服心动
臣服心动 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:36

    //define property of button

    Declare Unchaked Image

       - (void)viewDidLoad
       {
           [ButtonChaked setBackgroundImage:[UIImage imageNamed:@"UnChacked.png"] forState:UIControlStateNormal];
        }
    

    Chaked Image.

     - (IBAction)ButtonChaked:(id)sender
     {
        if (ButtonChaked.selected ==YES)
        {
          [ButtonChaked setBackgroundImage:[UIImage imageNamed:@"UnChacked.png"] forState:UIControlStateSelected];
    
        ButtonChaked.selected =NO;
    
     }
     else
     {
        [ButtonChaked setBackgroundImage:[UIImage imageNamed:@"Chaked.png"] forState:UIControlStateNormal];
        ButtonChaked.selected = YES;
    
     }
    
    
    }
    

    that's really used

提交回复
热议问题