13.小项目:图片浏览器 版本3.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;

@property (nonatomic, strong) NSArray *datas;

- (IBAction)nextImage;

- (IBAction)preImage;

-(void)changeImage;

@end

@implementation ViewController

-(void)viewDidLoad

{

[super viewDidLoad];

[self nextImage];

}

-(NSArray *)datas

{

if (_datas == nil)

{

NSDictionary *d1 = @{@"icon":@"biaoqingdi", @"desc":@"在他面前,其他神马表情都弱爆了!"};

NSDictionary *d2 = @{@"icon":@"bingli", @"desc":@"这也忒狠了"};

NSDictionary *d3 = @{@"icon":@"chiniupa", @"desc":@"这小姑娘吃个牛排比杀牛还费劲啊"};

NSDictionary *d4 = @{@"icon":@"danteng", @"desc":@"亲,你能改下你的网名吗"};

NSDictionary *d5 = @{@"icon":@"wangba", @"desc":@"哥们为什么选八号呢"};

self.datas = @[d1,d2,d3,d4,d5];

}

return _datas;

}

-(void)changeImage

{

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

NSDictionary *data = self.datas[self.index-1];

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

self.infoLabel.text = data[@"desc"];

self.leftBtn.enabled = self.index != 1;

self.rightBtn.enabled = self.index != self.datas.count;

}

- (IBAction)nextImage

{

self.index++;

[self changeImage];

}

- (IBAction)preImage

{

self.index--;

[self changeImage];

}

@end

时间: 2024-10-22 11:23:06

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

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

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

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

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 应用效果图: 小蔡图片浏览器