Square & Rounded corner for UIElements


/ Published in: Objective C
Save to your folder(s)

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

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.