I am having a problem setting the border colour on a UIView. If set tempColor to [UIColor lighGreyColor], [[UIColor alloc] initWithRed:0 green:0 blue:0 alpha:1.0], or [UIColor blueColor], the border gets set as expected. However, the code below does not set the colour and no border appears. unamecontainer is UIView. Any ideas why I can set the border colour to the colours mentioned above, and not the to the colour below.
UIColor *tempColor = [[UIColor alloc] initWithRed:169 green:201 blue:229 alpha:1.0];
self.unamecontainer.layer.borderColor = tempColor.CGColor;
self.unamecontainer.layer.borderWidth = 1.0;
The RGB values for
UIColorneed to be in the range[0, 1], so you need to divide each value by255.0(not255because that is integer division) to get a percentage: