sabar sabar - 1 year ago 104
iOS Question

Make a button like circle without image in iOS using objective c

I am new in Objective c. I have some buttons on storyboard. I want to make all these buttons like circle.
All buttons are colored without images.
How i can do it using objective c ?

Answer Source

As you said you want to make all buttons round which is in storyboard, you have to take For in loop:

for(UIButton *btn in [self.view subviews]) {
    if ([btn isKindOfClass:[UIButton class]])
         btn.clipsToBounds = YES;
         btn.layer.cornerRadius = btn.bounds.size.width/2;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download