ios字体设置
来源:互联网 发布:evdo.evdo_a是什么网络 编辑:程序博客网 时间:2024/05/22 09:17
在IOS程序中设置UIButton的字体大小 附:创建按钮的两种方法:
1、动态创建
btnfont = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btnfont setFrame:CGRectMake(100, 10, 120, 40)];
[btnfont addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[btnfont setTitle:@"字体" forState:UIControlStateNormal];
btnfont.backgroundColor=[UIColor clearColor];
[self.view addSubview:btnfont];
2、在xib文件中已经创建好,通过tag获取按钮
UIButton *testButton= (UIButton*)[self.view viewWithTag:100];
[testButton addTarget:self action:@selector(test:) forControlEvents:UIControlEventTouchUpInside];
注册事件
-(void) test: (id) sender{
UIAlertView *av = [[[UIAlertView alloc] initWithTitle:@"ceshi" message:@"test11111" delegate:nil cancelButtonTitle:@"OK"otherButtonTitles:nil] autorelease];
[av show];
}
1、动态创建
btnfont = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[btnfont setFrame:CGRectMake(100, 10, 120, 40)];
[btnfont addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
[btnfont setTitle:@"字体" forState:UIControlStateNormal];
btnfont.backgroundColor=[UIColor clearColor];
[self.view addSubview:btnfont];
2、在xib文件中已经创建好,通过tag获取按钮
UIButton *testButton= (UIButton*)[self.view viewWithTag:100];
[testButton addTarget:self action:@selector(test:) forControlEvents:UIControlEventTouchUpInside];
注册事件
-(void) test: (id) sender{
UIAlertView *av = [[[UIAlertView alloc] initWithTitle:@"ceshi" message:@"test11111" delegate:nil cancelButtonTitle:@"OK"otherButtonTitles:nil] autorelease];
[av show];
}
0 0
- iOS 设置字体 自定义字体
- iOS 设置字体 自定义字体
- iOS 设置字体 自定义字体
- [iOS] UIFont 设置字体
- IOS 字体设置
- IOS UIFont 设置字体
- ios字体设置
- Ios字体设置
- 【iOS】UIFont 设置字体
- iOS UIFont 设置字体
- iOS字体的设置
- ios字体设置
- ios 字体设置
- [iOS] UIFont 设置字体
- [iOS] UIFont 设置字体
- iOS字体设置
- iOS fontWithName字体设置
- [iOS] UIFont 设置字体
- 常见排序算法
- JS的select操作
- Android ListView的OnItemClickListener详解
- (含代码)WinCE6.0 Camera驱动的挂载,使应用层能使用DirctShow访问
- hadoop 2.2.0编译最后一步mvn package中各个问题解决办法
- ios字体设置
- C++ new[]和delete[]
- 黑马程序员---StringBuffer
- cocos2dx之初始化layer
- Phoenix Framwork怎么支持多批测试数据
- 里氏代换 -- 子类可以替换父类
- HTTP协议/IIS 原理及ASP.NET运行机制浅析【图解】(1)
- 【九度】题目1006:ZOJ问题
- hibernate jpa 4.0.3 final 的一些问题