Coder Social home page Coder Social logo

yjtagview's Introduction

YJTagView

介绍

封装了开发过程中常用到的tag(标签)的使用,并提供友好的API(模仿UITableView)

效果展示

特点

  • 根据标签文字自动计算tag的宽度
  • 根据tags自动计算tagView的高度
  • 可自定义配置字体大小,颜色,圆角等
  • 配置最大展示数量等

使用方法

  • 将demo中的YJTagView目录复制到项目中
  • 在需要使用tagView的Controller添加 #import "YJTagView.h"
  • 创建tagView视图对象,通过IB或者Frame
  • 调用一下API进行自定义展示
@protocol YJTagViewDataSource <NSObject>

@required
- (NSInteger)numOfItems;

- (NSString *)tagView:(YJTagView *)tagView titleForItemAtIndex:(NSInteger)index;

@end

@protocol YJTagViewDelegate <NSObject>

@optional
- (void)tagView:(YJTagView *)tagView didSelectedItemAtIndex:(NSInteger)index;

/**
 使用frame布局实现一下代理方法获得填充数据后的正确的高度(高度已内部调整)

 @param tagView tagView
 @param height 高度
 */
- (void)tagView:(YJTagView *)tagView heightUpdated:(CGFloat)height;

@end

详细使用可见demo

yjtagview's People

Contributors

huyangjake avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.