The following code will make the UIImageView round cornered with border to it :
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(42, 2, 55, 26)]; // Creating a UIImageView object imgView.image = [UIImage imageNamed:@"myImage.png"]; // Adding image to the UIImageVIew object imgView.contentMode = UIViewContentModeScaleAspectFill; // Setting the content mode for the UIImageView imgView.clipsToBounds = YES; // For rounded corners: imgView.layer.cornerRadius = 6.0; // Setting the corner radius imgView.layer.masksToBounds = YES; // For enabling masking //For adding border imgView.layer.borderColor = [UIColor whiteColor].CGColor; // Setting the border color imgView.layer.borderWidth = 2.0; // Setting the border width |
Incoming search terms:
- ios CGRectMake round corner
- how to make white border around images in android gallery programmatically
- making uiimageview round cornered
- objective c: how to creating a circular
- photoshop round corner xcode round corner
- programmatically create circular phone dialer in iOS
- uiimage circle mask
- uiimage rounded corners border
- uiimageview border
- xcode imageview mask



