Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

UITextField background Issue.

Hi,


This is what my code.


- (void) viewDidLoad {

[super viewDidLoad];


UIImage *image = [UIImageimageNamed:@"btn_facebook.png"];

image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 1, 0)];


txtEmailId = [[UITextFieldalloc] initWithFrame:CGRectMake(10, 30, 300, 44)];

[txtEmailIdsetDelegate:self];

[txtEmailIdsetBorderStyle:UITextBorderStyleNone];

[txtEmailId setBackground:image];

[txtEmailIdsetDisabledBackground:image];

[txtEmailIdsetFont:[UIFontfontWithName:@"HelveticaNeue"size:16]];

[txtEmailIdsetContentVerticalAlignment:UIControlContentVerticalAlignmentCenter];

[txtEmailIdsetClearButtonMode:UITextFieldViewModeWhileEditing];

[txtEmailIdsetAutocapitalizationType:UITextAutocapitalizationTypeNone];

[txtEmailIdsetAutocorrectionType:UITextAutocorrectionTypeNo];

[txtEmailIdsetReturnKeyType:UIReturnKeyNext];

[[selfview] addSubview:txtEmailId];

}


- (void) textFieldDidBeginEditing:(UITextField *)textField {

[txtEmailIdsetBackground:nil];

}


- (void)textFieldDidEndEditing:(UITextField *)textField {

UIImage *image = [UIImage imageNamed:@"btn_line.png"];

image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 1, 0)];


[txtEmailId setBackground:image];

}


the background is not getting changed after i set it to nil. I want to dynami i googled lot but i couldnt found a solution for this.

iPod touch, iOS 5

Posted on Dec 11, 2012 8:00 AM

Reply

There are no replies.

UITextField background Issue.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.