IOS基本控件使用
来源:互联网 发布:讲不出再见知乎 编辑:程序博客网 时间:2024/04/29 03:15
UIImageView
UIImageView *sport = [[UIImageView alloc]initWithFrame:CGRectMake(30, 202, 66, 68)];
sport.image = [UIImage imageNamed:@"cardSport.png"];
sport.userInteractionEnabled=YES;
UITapGestureRecognizer *singleTap1 =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(onClickImage1)];
[sport addGestureRecognizer:singleTap1];
[singleTap1 release];
UILabel
UILabel * name = [[UILabel alloc]initWithFrame:CGRectMake(89, 104, 143, 46)];
// name.text = @" ";
// name.backgroundColor = [UIColor clearColor];
name.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"Matching Game.png"]];
UIButton
UIButton * setting =[[UIButton alloc]init];
// UIButton *setting = [UIButton buttonWithType:UIButtonTypeRoundedRect];
setting.frame = CGRectMake(224, 382, 73, 44);
setting.titleLabel.textColor= [UIColor blackColor];
[setting setTitle:@" " forState:UIControlStateNormal];
[setting addTarget:self action:@selector(gotosettinggame:) forControlEvents:UIControlEventTouchUpInside];
setting.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"setting.png"]];
UISwitch
UISwitch *switch1 = [[UISwitch alloc]initWithFrame:CGRectMake(212, 268, 79, 27)];
UISwitch *switch2 = [[UISwitch alloc]initWithFrame:CGRectMake(212, 349, 79, 27)];
// [switch1 setOn:YES];
[switch1 setOn:voiceon];
[switch1 addTarget:self action:@selector(switchAction1:) forControlEvents:UIControlEventValueChanged];
// [switch2 setOn:YES];
[switch2 setOn:soundon];
[switch2 addTarget:self action:@selector(switchAction2:) forControlEvents:UIControlEventValueChanged];
UISegmentedControl
NSArray *array=@[@"easy",@"middle",@"difficult"];
UISegmentedControl *segcontro=[[UISegmentedControl alloc]initWithItems:array];
segcontro.segmentedControlStyle=UISegmentedControlStyleBordered;
//设置位置 大小
segcontro.frame=CGRectMake(54, 179, 235, 44);
//默认选择
segcontro.selectedSegmentIndex=1;
//设置背景色
segcontro.tintColor=[UIColor greenColor];
//设置监听事件
[segcontro addTarget:self action:@selector(change:) forControlEvents:UIControlEventValueChanged];
UIProgressView
@property (nonatomic,retain)UIProgressView *powerBar;
powerBar=[[UIProgressView alloc]initWithFrame:CGRectMake(80, 20, 150, 9)];
//powerBar.progress = 1.0*(1/60)*gametime;
NSString *stringFloat = [NSString stringWithFormat:@"%f",100-1.0*1/60*gametime*100];
[powerBar setProgress:1.0*1/60*gametime];
- IOS基本控件使用
- ios控件 UITableView 基本使用
- iOS开发最基本控件的使用
- IOS中UI控件的基本使用
- iOS中的基本 UI 控件的使用
- iOS常见控件的基本使用
- IOS的基本控件的使用-UILabel
- IOS的基本控件的使用-UIButton
- IOS的基本控件的使用-UIScrollView
- iOS控件-UICollectionView基本使用详解
- IOS的基本控件的使用-UIView的基本属性
- IOS的基本控件的使用-UISwitch控件
- IOS的基本控件的使用-UIViewController使用
- IOS基本控件
- iOS基本控件<一>
- iOS基本控件<二>
- IOS 基本控件使用方法
- ios 基本控件总结
- vs2010 c#调用mstscax.dll实现远程桌面连接
- android sdk manager proxy
- Java EE 8愿望清单:缺少这些,Java EE将不会完美
- apache和php的问题
- 一致性Hash
- IOS基本控件使用
- Python核心编程-网络爬虫的分析
- MOOC——C语言6
- C语言快速入门系列(三)
- GUI事件监听键盘监听器
- 学习java
- GUI事件监听鼠标监听器
- shape学习
- Lucene/Solr Architecture/Elasticsearch