iOS开发中实现一个简单的图片浏览器的实例讲解

2020-01-14 18:56:02丽君
易采站长站为您分析iOS开发中实现一个简单的图片浏览器的实例讲解,代码基础传统的Objective-C,需要的朋友可以参考下  

一、程序实现要求

1.要求

iOS开发中实现一个简单的图片浏览器的实例讲解

2. 界面分析

(1) 需要读取或修改属性的控件需要设置属性

  • 序号标签
  • 图片
  • 图片描述
  • 左边按钮
  • 右边按钮

    (2) 需要监听响应事件的对象,需要添加监听方法

    • 左边按钮
    • 右边按钮

      二、实现基本功能的程序

      复制代码
      //
      //  YYViewController.m
      //  03-图片浏览器初步
      //
      //  Created by apple on 14-5-21.
      //  Copyright (c) 2014年 itcase. All rights reserved.
      //

       

      #import "YYViewController.h"

      #define POTOIMGW    200
      #define POTOIMGH    300
      #define POTOIMGX    60
      #define  POTOIMGY    50


      @interface YYViewController ()

      //变量声明!
      @property(nonatomic,strong)UILabel *firstlab;
      @property(nonatomic,strong)UILabel *lastlab;
      @property(nonatomic,strong)UIImageView *icon;
      @property(nonatomic,strong)UIButton *leftbtn;
      @property(nonatomic,strong)UIButton *rightbtn;

      -(void)change;
      @property(nonatomic ,assign)int i;
      @end

      @implementation YYViewController