将所选值放入文本字段中
当用户在 pickerView 中选择一个项目并按“确定”按钮时,我必须将所选项目放入 UITextField 中,那么在“确定”按钮的 IBAction 中我应该放置什么?提前谢谢:) 这是我的“确定”按钮代码:
-(IBAction)okButton{
[billTotal setText:@"Hi"];//the text field name is billTotal, this didn't work :(
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
CGAffineTransform transform = CGAffineTransformMakeTranslation(0, 480);
pickerView.transform = transform;
[UIView commitAnimations];
}
when the user select an item in a pickerView and press OK button, i have to put the selected item in a UITextField, so in the IBAction of the OK button what should i put please ? thx in advance :)
this is my OK button code :
-(IBAction)okButton{
[billTotal setText:@"Hi"];//the text field name is billTotal, this didn't work :(
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
CGAffineTransform transform = CGAffineTransformMakeTranslation(0, 480);
pickerView.transform = transform;
[UIView commitAnimations];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样的东西:
检查您的插座是否连接到文本字段,并且调用了“okButton”选择器
Something like this:
Check if your outlet connected to text field, and that "okButton" selector is called