There is a UITextField with 2 elements (rightView and leftView):

 label.text = @"Ваш пол"; clientGender.leftViewMode = UITextFieldViewModeAlways; clientGender.leftView = label; UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrow.png"]]; clientGender.rightViewMode = UITextFieldViewModeAlways; clientGender.rightView = imageView; 

Question: how to indent for the text field, since leftView (the inscription "Your floor") - fits on the textview

UPD. The issue is resolved by creating a subclass for UITextField with such a perversion: /

 - (id)initWithCoder:(NSCoder*)coder { self = [super initWithCoder:coder]; if (self) { self.clipsToBounds = YES; [self setRightViewMode:UITextFieldViewModeUnlessEditing]; [self setLeftViewMode:UITextFieldViewModeUnlessEditing]; //self.leftView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"textfield_edit_icon.png"]]; } return self; } - (CGRect) rightViewRectForBounds:(CGRect)bounds { CGRect textRect = [super rightViewRectForBounds:bounds]; textRect.origin.x -= 10; return textRect; } - (CGRect) leftViewRectForBounds:(CGRect)bounds { CGRect textRect = [super leftViewRectForBounds:bounds]; textRect.origin.x += 10; return textRect; } - (CGRect)textRectForBounds:(CGRect)bounds{ CGRect textRect = [super textRectForBounds:bounds]; textRect.origin.x += 0; textRect.size.width -= 10; return textRect; } 
  • Firstly, it is not clear why TextView is here? secondly, why not using autolayouts and lines? - BiMaWa
  • I definitely need an educational program for auto-loops. I turn them off, because I read somewhere that they need to be turned off. In fact, I am making a text field with the word “Your floor” on the left, the selected floor of the picker in the middle, and the arrow on the right. I hope clearly explained :) - michilly
  • What you describe is more like a UITableViewCell in the style of UITableViewCellStyleValue1 with the indicator disclousure turned on. about the ligbase, just read: amazon.com/Auto-Layout-Demystified-Mobile-Programming-ebook/dp/… Very clearly and clearly written. - BiMaWa

0