Search code examples
iosobjective-cuibuttonbounds

how to increase the size of UIButtonTypeInfoLight


i have tried the below code , but size of button is remains same

UIButton * pInfoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];

[pInfoButton setFrame:CGRectMake(100,100, 80, 80)];

[pInfoButton setBounds:CGRectMake(0, 0, 80, 80)];

[self.view addSubview:pInfoButton];

please tell me how to increase it's size , thanks in advance


Solution

  • You can increase it applying CGAffineTransform to the button: pInfoButton.transform = CGAffineTransformMakeScale(1.2, 1.2);. But in this case you'll lose a quality.

    Another solution is to create custom button with background.