In my project have added image on my tableview cell, for this I have tried some code but that's not working, what did I do here wrong?
Here my main requirement is I want to round that image (as like circle format).
My code:
Personimage = [[UIImageView alloc]init];
Personimage.image = [UIImage imageNamed:@"ram.jpeg"];
Personimage.translatesAutoresizingMaskIntoConstraints = NO;
[Cell.contentView addSubview:Personimage];
//Applying autolayouts
NSDictionary * viewsDic = NSDictionaryOfVariableBindings(Personimage)
[Cell.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-10-[Personimage(80)]"
options:0
metrics:nil
views:viewsDic]];
[Cell.contentView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-10-[Personimage(80)]"
options:0
metrics:nil
views:viewsDic]];
}
-(Void)ViewDidAppear
{
Personimage.layer.cornerRadius = Personimage.frame.size.width / 2;
Personimage.layer.borderWidth = 3.0f;
Personimage.layer.borderColor = [UIColor whiteColor].CGColor;
Personimage.clipsToBounds = YES;
}
After applying auto-layouts i have kept image"round" properties in viewDidAppear method but still it's not working what did i do wrong here? please help me someone