Posted By

alenalexander77gmailcom on 11/04/15


Tagged

iOSObjective-CiPhoneiPad


Versions (?)

Square & Rounded corner for UIElements


 / Published in: Objective C
 

Provide Square/Rounded corners for UIElements like UISegmentedControl, UIButton etc.

Use 'cornerradius' property for setting the type of corner.

  1. Rounded Corners
  2. --------------
  3. self.UIElementName.layer.cornerRadius = 7.0; // vary this radius value to achieve suitable corner
  4.  
  5. self.UIElementName.layer.borderWidth = 0.8f; //sets the border width of UIElement
  6. self.UIElementName.layer.borderColor = [UIColor redColor].CGColor;
  7.  
  8.  
  9.  
  10. Square Corners
  11. --------------
  12. self.UIElementName.layer.cornerRadius = 0.0; // sets the corner radius value to zero to get a square corner

Report this snippet  

You need to login to post a comment.