Use two TextFields or using label/view in background. Placing TextFields over some view/label/TextFields is not proper development. And placing label or view in left side isn't the proper way either
I didn't think below way is proper way. So i want a better solutions
UILabel * leftView = [[UILabel alloc] initWithFrame:CGRectMake(10,0,7,26)];
leftView.backgroundColor = [UIColor clearColor];
textField.leftView = leftView;
textField.leftViewMode = UITextFieldViewModeAlways;
textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
How can we use following to achieve it
// placeholder position
- (CGRect)textRectForBounds:(CGRect)bounds {
return CGRectInset( bounds , 10 , 10 );
}
// text position
- (CGRect)editingRectForBounds:(CGRect)bounds {
return CGRectInset( bounds , 10 , 10 );
}
I was able to achieve using . But is there some better way then this
Txt_SecurityAns.layer.sublayerTransform = CATransform3DMakeTranslation(5, 0, 0);
Txt_Email.layer.sublayerTransform = CATransform3DMakeTranslation(5, 0, 0);