Actually i have created Border in Textfiled by using this code.
CALayer *bottomBorder = [CALayer layer];
bottomBorder.frame = CGRectMake(0.0f, self.frame.size.height - 1, self.layer.frame.size.width, 1.0f);
bottomBorder.backgroundColor = self.BorderColor.CGColor;
[self.layer addSublayer:bottomBorder];
Everything is working fine upto iphone 5s but when i run in iphone 6 and above it's border size decrease. like if width of textfield is 120 border show only upto 100 . Don't know how to deal with That. Please Guide me through it
If you want to deal with CALayer then Try this following life cycle method.
-(void)viewDidLayoutSubviews
{
CALayer *bottomBorder = [CALayer layer];
bottomBorder.frame = CGRectMake(0.0f, self.frame.size.height - 1, self.layer.frame.size.width, 1.0f);
bottomBorder.backgroundColor = self.BorderColor.CGColor;
[self.layer addSublayer:bottomBorder];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With