添加动态按钮(UIAlertButton)
来源:互联网 发布:java真人面试视频 编辑:程序博客网 时间:2024/06/01 23:00
在根视图控制器类的.h文件中
#import <UIKit/UIKit.h>
@interface liViewController :UIViewController
//添加按钮
- (void) addButton;
@end
在.m文件中@implementation liViewController
- (void)viewDidLoad
{
[superviewDidLoad];
//调用自己的方法
[selfaddButton];
}
- (void) addButton
{
UIButton *button = [UIButtonbuttonWithType:UIButtonTypeRoundedRect];
button.frame =CGRectMake(100,200, 120, 40);
[button setTitle:@"点击按钮" forState:UIControlStateNormal];
//给按钮添加关联动作
[button addTarget:selfaction:@selector(addAlertButton:)forControlEvents:UIControlEventTouchUpInside];
[self.viewaddSubview:button];
// [button release];
}
- (void)addAlertButton:(id)sender
{ //添加动态按钮
UIAlertView *alertView = [[UIAlertViewalloc]initWithTitle:@"提示"message:@"点击了动态按钮" delegate:nilcancelButtonTitle:@"确定" otherButtonTitles:nil,nil];
//动态按钮的显示
[alertViewshow];
[alertViewrelease];
}
- (void)didReceiveMemoryWarning
{
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
- 添加动态按钮(UIAlertButton)
- gridview动态添加按钮
- UIActionSheet动态添加按钮
- Coolite动态添加按钮
- 动态添加按钮
- 添加动态按钮
- 动态添加UIActionSheet按钮
- 动态添加按钮
- iOS 动态添加按钮
- 动态添加UIActionSheet按钮
- 动态添加button按钮
- 动态添加发帖按钮
- 点击按钮动态添加新的一行(添加文本框)
- iOS开发:动态添加按钮
- IOS AlertView动态添加按钮
- MFC Ribbon 动态添加按钮
- iOS开发:动态添加按钮
- 第二章,动态添加按钮<一>(Android)
- color convex_hull
- 破窗理论
- javascript中计算两个时间日期间隔的天数
- C语言程序员必读的5本书
- mysql5.0 执行定时计划-Window系统
- 添加动态按钮(UIAlertButton)
- 谷歌15年:盘点助其走向成功的14条秘诀
- Selenium 2.0 WebDriver 使用指南
- springMVC的配置文件
- EAS 导入解决方案后无法创建视图:Init Metadata Jar:D:\eas705\workspace\Project_0\basemetas\bim_templates.zip Error.
- 像这样玩C#
- marrige problem
- 20131218早读课:真正优秀的用户界面会被无视
- 线程安全类的设计