iBokan_ios80_第一个2货UI
来源:互联网 发布:同步软件 编辑:程序博客网 时间:2024/05/18 08:59
<strong><span style="font-size:18px;">//// ViewController.m// 小婊砸//// Created by Ibokan_Ze on 15/7/6.// Copyright (c) 2015年 Ibokan. All rights reserved.//#import "ViewController.h"@interface ViewController ()@property(strong,nonatomic)UILabel *labelA;@property(strong,nonatomic)UIButton *button;@property(strong,nonatomic)UILabel *labelB;@end@implementation ViewController- (void)viewDidLoad { UIScreen *s = [UIScreen mainScreen]; CGRect frame = s.bounds; NSLog(@"高度是:%g\n宽度是:%g",frame.size.height,frame.size.width); self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"BGA.png"]]; [super viewDidLoad]; self.labelB = [[UILabel alloc] initWithFrame:CGRectMake(7.5, 100, 360, 50)]; self.labelB.textColor = [UIColor grayColor]; self.labelB.text = @"第一个UI界面"; self.labelB.textAlignment = NSTextAlignmentCenter; [self.view addSubview:self.labelB]; self.labelA = [[UILabel alloc] initWithFrame:CGRectMake(7.5, 150, 360, 50)]; self.labelA.textColor = [UIColor whiteColor]; self.labelA.textAlignment = NSTextAlignmentCenter;//对齐方式 self.labelA.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Label.png"]]; self.labelA.text = @"基础控件标签!"; [self.view addSubview:self.labelA]; self.button = [[UIButton alloc] initWithFrame:CGRectMake(7.5, 260, 360, 150)]; self.button.backgroundColor = [UIColor redColor]; [self.button setTitle:@"你TMD敢不敢点我" forState:UIControlStateNormal]; [self.button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [self.button addTarget:self action:@selector(tapButton:) forControlEvents:UIControlEventTouchUpInside]; [self.button setBackgroundImage:[UIImage imageNamed:@"IMG.png"] forState:UIControlStateNormal]; [self.view addSubview:self.button]; }- (void)tapButton:(UIButton *)btn{ static int count = 0; count++; NSString *str = [NSString stringWithFormat:@"你居然点我%d下了!",count]; self.labelA.text = str; [self.button setTitle:str forState:UIControlStateNormal]; if (count <= 10) { self.labelA.text = @"~~轻点~~"; }else if (count <= 20 && count > 10) { self.labelA.text = @"你怎么还在点我......"; }else if (count <= 50 && count > 20) { self.labelA.text = @"吃饭了,你妈妈叫你回家吃饭了!"; self.labelB.text = @"你妈妈:我可没叫他吃饭!"; }else if(count > 50) { self.labelA.text = @"你太无聊了哦~~"; } }- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated.}@end</span></strong>
0 0
- iBokan_ios80_第一个2货UI
- 第一个UI界面
- UI_01.第一个ios UI
- UI01-第一个UI程序
- ios ui第一课,创建第一个ui程序
- 第一个项目UI界面设计完成---总结
- jquery ui ComboBox默认选中第一个
- UI第一个出画面的代码
- 我的第一个UI程序
- UI基础-01第一个iOS应用程序
- python+robotframework --第一个UI自动化脚本
- 2、Selenium + Python 实现 UI 自动化测试-第一个自动化测试脚本
- 完成第一个android APP的UI项目
- ANDROID第一个UI界面学---登录到对话框
- 第一个小问题:forward declaration of struct Ui::
- UI基础-基础控件-0323-第一个IOS程序计算器
- 使用semantic ui做的第一个网页
- 第一个任务2
- 安卓开发——获取安卓存储的权限
- 给出4个整数,找出最大者,使用函数嵌套
- Android Notification详解——响应notification事件
- linux区分大小写,windows不区分
- 设计模式
- iBokan_ios80_第一个2货UI
- IOS开发UI篇--一个支持图文混排的ActionSheet
- 对话框容器环境响应Active控件事件 动态创建ActiveX
- 实现用代码修改图片来进行屏幕适配
- C#基础总结
- 【从零单排之微软面试100题系列】05之查找最小的k个元素
- Android studio 多渠道打包
- poj 3692 Kindergarten (最大独立集)
- 如何Android中自定义Navigationbar