uitextfield not display leftview
UITextField * fromField = [[UITextField alloc] initWithFrame: CGRectMake (43,8,215,30)];
fromField.delegate = self;
fromField.backgroundColor = [[UIColor alloc] initWithPatternImage: [UIImage imageNamed: @ "input_field.png"]];
fromField.textAlignment = UITextAlignmentLeft;
fromField.clearButtonMode = UITextFieldViewModeWhileEditing;
fromField.returnKeyType = UIReturnKeyGo;
fromField.placeholder = @ "Enter the starting point";
fromField.tag = indexPath.row;
fromField.font = [UIFont fontWithName: @ "Arial" size: 12.0];
fromField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
UILabel * lbl = [[UILabel alloc] initWithFrame: CGRectMake (0, 0, 45, 21)];
lbl.backgroundColor = [UIColor clearColor];
lbl.textColor = [UIColor lightGrayColor];
lbl.text = @ "Start:";
UIButton * btnLeftImg = [UIButton buttonWithType: UIButtonTypeCustom];
[BtnLeftImg setBackgroundImage: [UIImage imageNamed: @ "hint_start_point.png"] forState: UIControlStateNormal];
btnLeftImg.frame = CGRectMake (0, 0, 9,9);
fromField.leftView = lbl;
Reply:
Do not understand it?
Reply:
Try adding this:
fromField.leftViewMode = UITextFieldViewModeAlways;
Reply:
What kind of effect?
LZ help top up
Reply:
Is not to be blocking the view?
Reply:
2nd Floor positive solutions
No comments:
Post a Comment