I am setting up a UIImageView as a leftView on a UITextField like so:
UIImageView *envelopeView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.height*.1, self.height*.1)]; envelopeView.image = [UIImage imageNamed:@"envelope.png"]; envelopeView.contentMode = UIViewContentModeScaleAspectFit; envelopeView.bounds = CGRectInset(envelopeView.frame, 15, 10); self.emailAddress.leftView = envelopeView; self.emailAddress.leftViewMode = UITextFieldViewModeAlways; which gets me the following:
As you can see the left size of the image goes right up to the left edge of the button even though I tried to set an inset. How can I move this envelope in so that it's got padding on all sides?
Update: I tried the proposed answer of changing the UIImageView frame like so, but the envelope is still lined up on the left side at the border of the UITextField:
CGFloat padding = 20; UIImageView *envelopeView = [[UIImageView alloc] initWithFrame:CGRectMake(3*padding, padding, self.height*.1-padding, self.height*.1-padding)]; 

