开发者

How to customize UITextField like this?

开发者 https://www.devze.com 2023-02-05 23:37 出处:网络
another questions... How can i make this textfield?? With on the left a FIXED placeholder with a string and after it, an touchable zone, with tex开发者_开发技巧t or the blue rectangle like screen

another questions...

How can i make this textfield??

How to customize UITextField like this?

How to customize UITextField like this?

With on the left a FIXED placeholder with a string and after it, an touchable zone, with tex开发者_开发技巧t or the blue rectangle like screenshot.

I need to implement a view? Or there is a simple way to do it directly in textfield?

thanks again!

A


I have the solution!!!

UITextField have a property named leftView and rightView!

Here's the code:

UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(1, 1, 60, 25) ];
[lbl setText:@"Partenza:"];
[lbl setFont:[UIFont fontWithName:@"Verdana" size:12]];
[lbl setTextColor:[UIColor grayColor]];
[lbl setTextAlignment:NSTextAlignmentRight];
_txtFrom.leftView = lbl;
_txtFrom.leftViewMode = UITextFieldViewModeAlways;
_txtFrom.delegate = self;

and this is the output:

How to customize UITextField like this?


Take a look at the TTMessageRecipientField. On the Mac, this is achieved with an NSTokenField, but this isn't available in UIKit.

0

精彩评论

暂无评论...
验证码 换一张
取 消