[Code Note] changes the background of the text input box and the text input box of the Code note.
I ,.
2. Engineering Drawing.
3. Code.
RootViewController. h
#import <UIKit/UIKit.h>@interface RootViewController : UIViewController<UITextFieldDelegate>@end
RootViewController. m
-(Void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view. // initialization background [self addView];} # pragma-mark-functions-(void) addView {UITextField * textField = [[UITextField alloc] initWithFrame: CGRectMake (50,100,200, 50)]; textField. backgroundColor = [UIColor redColor]; textField. delegate = self; [self. view addSubview: textField] ;}# pragma-mark-UITextFieldDelegate-(BOOL) fields :( UITextField *) textField {[textField setBackground: [UIImage imageNamed: @ "1.jpg"]; return YES;}-(void) encode :( UITextField *) textField {[textField setBackground: [UIImage imageNamed: @ "2.jpg"];}-(BOOL) textFieldShouldReturn: (UITextField *) textField {[TextField resignFirstResponder]; return YES ;}