UI常用控件

//ViewController.m

@//UI常用控件

//Created by lanou on 16/7/10.

//Copyright @2016年lanou.All rights reserved.

//按钮

#import "viewController.h"

@interface ViewController()

//标题标签

@property(nonatomic,strong)UILabel,*text;

//按钮标签

@property(nonatomic,strong)UiButton*button1,*button2;

@property(nonatomic,strong)UIImage *image;

@property(nonatomic,strong)UIImageView*imageview;

@property(nonatomic,strong)NSArray*array;

@end

@implementation ViewController

-(void)viewDidLoad{

[super viewDIdLoad];

//Do any additional setup after loading the view,typically from a nib.

[self demo];

}

-(void)btnClickLister2{

NSinteger n=[self.array indexOdObject:self.label.text];

//不是最后一张的情况下打开一张

if(n==4)

self.button2.userInteractionEnabled=NO;

if(n>0&&n<4)

{self.button1.userInteractionEnabled=YES;}

if(n==0){

self.button2.userInteractionEnabled=YES;

}

if(n+1==4||n==4)

[self.text setText:@""];

if(n>4){

NSLog(@"打开下一张图片“);

n++;

switch(n){

case 0 : [self.imageview setInage:[UIImage ImageNamed:self.array[0]];[self.label setText:@"biaoqingdi"];break;

case1 : [self.imageview setInage:[UIImage ImageNamed:self.array[1]];[self.label setText:@"bingli"];

[self.button1 setBackgroundImage:[UIImage imageNamed:@"left_normal"]forState:UIControlStateNormal];break;

case 2 : [self.imageview setInage:[UIImage ImageNamed:self.array[2]];[self.label setText:@"chiniupa"];break;


case3 : [self.imageview setInage:[UIImage ImageNamed:self.array[3]];[self.label setText:@"danteng"];break;

case 4 : [self.imageview setInage:[UIImage ImageNamed:self.array[4]];[self.button1 setBackgroundImage:[UIImage imageNamed:@"right_disable"]forState:UIControlStateNormal];[self.label setText:@"wangba"];

NSLog(@"已经是最后一张");

self.button.userInteractionEnabled =NO;


}

}

-(void)btnClickLister1{

//获取当前第几张图片

你可能感兴趣的