10.小项目:图片浏览器 版本1.0

---------------  ViewController.m  ---------------

#import <Foundation/Foundation.h>

#import "ViewController.h"

@interface ViewController ()

@property (weak, nonatomic) IBOutlet UILabel *indexLabel;

@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@property (weak, nonatomic) IBOutlet UILabel *infoLabel;

@property (nonatomic, assign) int index;

@property (weak, nonatomic) IBOutlet UIButton *rightBtn;

@property (weak, nonatomic) IBOutlet UIButton *leftBtn;

- (IBAction)nextImage;

- (IBAction)preImage;

@end

@implementation ViewController

-(void)viewDidLoad

{

[super viewDidLoad];

[self nextImage];

}

- (IBAction)nextImage

{

self.index++;

self.indexLabel.text = [NSString stringWithFormat:@"%d/5",self.index];

switch (self.index) {

case 1:

self.imageView.image = [UIImage imageNamed:@"biaoqingdi"];

self.infoLabel.text = @"在他面前,其他神马表情都弱爆了!";

break;

case 2:

self.imageView.image = [UIImage imageNamed:@"bingli"];

self.infoLabel.text = @"这也忒狠了";

break;

case 3:

self.imageView.image = [UIImage imageNamed:@"chiniupa"];

self.infoLabel.text = @"这小姑娘吃个牛排比杀牛还费劲啊";

break;

case 4:

self.imageView.image = [UIImage imageNamed:@"danteng"];

self.infoLabel.text = @"亲,你能改下你的网名么?哈哈";

break;

case 5:

self.imageView.image = [UIImage imageNamed:@"wangba"];

self.infoLabel.text = @"哥们为什么选八号呢";

self.rightBtn.enabled = NO;

break;

default:

break;

}

if (self.index == 1)

{

self.leftBtn.enabled = NO;

}else

{

self.leftBtn.enabled = YES;

}

}

- (IBAction)preImage

{

self.index--;

self.indexLabel.text = [NSString stringWithFormat:@"%d/5",self.index];

self.rightBtn.enabled = YES;

switch (self.index) {

case 1:

self.imageView.image = [UIImage imageNamed:@"biaoqingdi"];

self.infoLabel.text = @"在他面前,其他神马表情都弱爆了!";

self.leftBtn.enabled = NO;

break;

case 2:

self.imageView.image = [UIImage imageNamed:@"bingli"];

self.infoLabel.text = @"这也忒狠了";

break;

case 3:

self.imageView.image = [UIImage imageNamed:@"chiniupa"];

self.infoLabel.text = @"这小姑娘吃个牛排比杀牛还费劲啊";

break;

case 4:

self.imageView.image = [UIImage imageNamed:@"danteng"];

self.infoLabel.text = @"亲,你能改下你的网名么?哈哈";

break;

case 5:

self.imageView.image = [UIImage imageNamed:@"wangba"];

self.infoLabel.text = @"哥们为什么选八号呢";

break;

default:

break;

}

}

@end

@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

时间: 2024-11-07 02:22:52

10.小项目:图片浏览器 版本1.0的相关文章

13.小项目:图片浏览器 版本3.0

---------------  ViewController.m  --------------- #import <Foundation/Foundation.h> #import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UILabel *indexLabel; @property (weak, nonatomic) IBOutlet UII

12.小项目:图片浏览器 版本3.0

@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); ---------------  ViewController.m  --------------- #import <Foundation/Foundation.h> #import "ViewController.h" @interf

11.小项目:图片浏览器 版本2.0

@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); ---------------  ViewController.m  --------------- #import <Foundation/Foundation.h> #import "ViewController.h" @interf

14.小项目:图片浏览器 版本4.0

--------------- ViewController.m --------------- #import <Foundation/Foundation.h> #import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UILabel *indexLabel; @property (weak, nonatomic) IBOutlet UIIma

32.小项目:喜马拉雅 版本3.0

更新说明:图片轮播器拖拽图片时暂停轮播. ------------- ViewController.m ------------- #import "ViewController.h" #define IMAGE_COUNT 5 @interface ViewController () <UIScrollViewDelegate> @property (weak, nonatomic) IBOutlet UIScrollView *scrView; @property (n

31.小项目:喜马拉雅 版本2.0

@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); @import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); 更新说明:添加图片轮播器 --

30.小项目:喜马拉雅 版本1.0

------------- ViewController.m ------------- #import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutlet UIScrollView *scrView; @property (nonatomic,strong) NSArray *arrs; @end @implementation ViewController - (N

CardLayout布局练习(小的图片浏览器)

1 /* 2 涉及Panel中的图片的加载,还有Frame的关闭的方法, CardLayout(int hgap, int vgap)就会决定卡片面板的大小 3 匿名类的使用... 4 */ 5 import java.awt.*; 6 import java.awt.event.*; 7 import javax.swing.*; 8 public class CardLayoutDemo extends Frame{ 9 Panel pCards=new Panel();//卡片面板 10

小蔡图片浏览器

小蔡图片浏览器,这是基于Android4.4开发的一款浏览手机里的图片的浏览器.简单美观实用.欢迎下载. 下载地址:http://download.csdn.net/detail/jczmdeveloper/7329593 应用效果图: 小蔡图片浏览器