0
A
回答
1
已经创建和模板结合的方法,这样只是改变insertNewObject
方法这样
- (void)insertNewObject:(id)sender
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"This is an alert" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
}
0
你应该创造一个
-(IBAction)SomeAction{ //display your alert view }
不要忘记把它挂在IB
+0
但是,我怎么知道用户何时按下了添加(+)按钮? – ivantxo 2012-03-27 10:00:53
1
使用以下代码,
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addButtonActionName)];
它会在导航栏的右上角显示+
按钮。
-(void) addButtonActionName {
// Your code for the Alert view
}
0
下面是在导航添加BarButton酒吧
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(ShowMyAlert:)];
&这是为事件处理代码...
- (void)ShowMyAlert:(id)sender
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Test Alert Message" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
相关问题
- 1. 向后退按钮添加操作
- 2. 按钮添加项目的操作
- 3. 将操作添加到NSRunAlertPanel的按钮
- 4. 在HTML中添加操作按钮
- 5. 添加iPhone分享按钮
- 6. 如何将操作按钮/操作添加到UILocalNotification警报中?
- 7. Android。我想添加操作以将操作添加到main.xml按钮
- 8. 按钮操作没有响应iphone
- 9. 将“清除”按钮添加到iPhone UITextField
- 10. 将按钮添加到iPhone prefs/settings包?
- 11. 如何将PNG添加UIAlert按钮iphone
- 12. 如何将按钮添加到textfield iphone?
- 13. 添加按钮动作条
- 14. iPhone按钮动作
- 15. HTML按钮 - 操作?
- 16. UIAlertView按钮操作?
- 17. 的按钮操作
- 18. Laravel按钮操作
- 19. 在操作栏中添加按钮。不是菜单,只是按钮
- 20. iPhone:添加按钮scrollview使按钮无法进入交互
- 21. iPhone app像“添加到主屏幕”按钮的按钮样式
- 22. 从UIView(.xib)加载UIViewController按钮操作
- 23. 使用浮动操作按钮添加组件
- 24. 将按钮添加到安卓操作栏
- 25. 不能将按钮/项目添加到Android操作栏
- 26. Xamarin - 在操作栏添加标题和按钮
- 27. 如何将操作添加到我的通知按钮?
- 28. 添加主页按钮操作栏的最后一项活动
- 29. 按钮单击添加操作URL的jQuery
- 30. 如何将操作添加到编程式按钮?
你必须加写btn行动方法 – 2012-03-27 10:00:04