• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

易用的iOS点九图框架 NinePatchKit

武飞扬头像
不期而遇Serendipity
帮助4

点九图简单介绍

iOS点九图框架 NinePatchKit

  • 介绍
    iOS / OSX点九图框架,可以方便快速的把点九图应用到项目中,应用效果图如下
    学新通

  • 用法

    • 1. 引入框架, 有以下两种方式

      • 1.1 pods 引入
        pod 'NinePatchKit'
        
      • 1.2 添加源文件到项目中
        • 添加文件夹 “NinePatchUtils” 内的所有文件到项目中
    • 2. 使用

      #import "ViewController.h"
      #import "Masonry.h"
      #import "NinePatchUtils.h"
      #import "NinePathImageView.h"
      
      @interface ViewController ()
      
      @property (nonatomic, strong) NinePathImageView * imageView;
      
      @end
      
      @implementation ViewController
      
      - (void)viewDidLoad
      {
        [super viewDidLoad];
      
        [self.view addSubview:self.imageView];
        [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.center.equalTo(self.view);
            make.width.equalTo(@(100));
            make.height.equalTo(@(50));
        }];
      
        // set .9 image for imageView
        self.imageView.showImage = [NinePatchUtils imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"5" ofType:@"png"]];
      }
      
      #pragma mark - Property
      -(NinePathImageView *)imageView
      {
        if (!_imageView)
        {
            _imageView = [[NinePathImageView alloc] init];
        }
      
        return _imageView;
      }
      
      @end
      
      
      学新通
    • 3. 详细使用可参考框架 Demo

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhfhjijh
系列文章
更多 icon
同类精品
更多 icon
继续加载