Code Monkey home page Code Monkey logo

dkattributelabel's Introduction

DKAttributeLabel

自己写的图文混排Label,可以满足基本社区类,IM类功能,可自行修改

##正则表达式解析 [#r{}#] #r:点击事件 #f:表情 #l:链接

###Key for touch redirect

t: subType
bc: background color
bsc: background selected color
tc: text color
tsc: text selected color
ct: conent show
id:content id

##Usage

DKAttributeLabel *label = [[DKAttributeLabel alloc]initWithFrame:CGRectMake(40, 40, [UIScreen mainScreen].nativeBounds.size.width/3-80, 200)];
label.delegate = self;      
label.text = @"大家好,我叫[#r:{\"t\":1,\"id\":0,\"ct\":\"陈独秀\"}#],[#f:1#][#f:2#][#f:3#][#f:4#][#f:4#] 我的我的我的我的我的网站是http://liudukun.com,lidukun.com,1.com,av.net,https://123,ftp://234,哈哈哈哈,我的帖子推荐给你:[#r:{\"t\":2,\"id\":1,\"ct\":\"第一次发帖哆哆asdfsdf关照,嗷嗷\",\"tc\":\"#ff0000\",\"bc\":\"#ffffff\"}#]";
[self.view addSubview:label];

##Touch DKAttributeLabelDelegate

- (void)actionNode:(DKAttributeNode *)node {
    NSLog(@"action node ,content =%@",node.content);
}

##End

dkattributelabel's People

Contributors

liudukun avatar

Stargazers

 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.