Created
October 26, 2013 18:53
-
-
Save psobko/7173180 to your computer and use it in GitHub Desktop.
UITextField padding with a custom leftView UIImageView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(UIView*)paddingViewWithImage:(UIImageView*)imageView andPadding:(float)padding | |
{ | |
float height = CGRectGetHeight(imageView.frame); | |
float width = CGRectGetWidth(imageView.frame) + padding; | |
UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, height)]; | |
[paddingView addSubview:imageView]; | |
return paddingView; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class func textFieldDesignWithLeftPadding(textField:UITextField,color:UIColor,placeHonderName:NSString,placeHolderColor:UIColor, padding:Int, image:UIImage)
{
let viewPadding = UIView(frame: CGRect(x: 0, y: 0, width: padding , height: Int(textField.frame.size.height)))