开发者

Edit UIButton text with keyboard

I have a UIButton that responds to a TouchUpInside ev开发者_StackOverflowent. Inside this event handler, I want to bring up the keyboard and allow the user to edit the text of the button. I have tried to set editing to YES as shown below, but this gives an unrecognized selector message...

-(void)editSelection:(id)sender
{
    [sender setEditing:YES];
}

Is there a way to edit text if the sender is a UIButton?


best set a text field over the button ( a borderless one) - and then [self.myVeryOwnButton setTitle:@"something" forControlState:UIControlStateNormal];

something of that nature.


I ended up creating a UITextField with the same frame as the button.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜