iBokan_ios80_第一个2货UI

<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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值