ex:
Enter鍵按下時觸發的method
-(void)textFieldDone:(UITextField*)textField
{
[textField resignFirstResponder];
}
建立TextField
textField = [[UITextField alloc] initWithFrame:
CGRectMake(5, 5,
image.size.width,
image.size.height)];
[imageView addSubview:textField];
[textField addTarget:self
action:@selector(textFieldDone:)
forControlEvents:UIControlEventEditingDidEndOnExit];
[textField release];
沒有留言:
張貼留言