Giter VIP home page Giter VIP logo

avery-an / coretext Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 11.07 MB

自定义Label并使用CoreText异步绘制label的富文本、支持url&at&topic高亮显示、支持url短链接、支持自定义的Emoji、支持同步/异步绘制、支持对超长文案的截断处理、支持文案的搜索、支持高亮文案的交互、支持异形Label的绘制;

License: MIT License

Objective-C 100.00%
label coretext attributedstring nsattributedstring asynchronous-rendering weibo texthighlighting

coretext's Introduction

CoreText

自定义Label并使用CoreText绘制label的富文本
如果用在tableView的Cell中, 请参考:https://github.com/Avery-AN/TableView

主要功能点:

在TableView中使用本label时、即便在iPhone6真机下每个cell包含10张大图时仍能达到60fps

  1. 支持高亮文案点击时的圆角背景
  2. 支持url高亮显示、支持url点击效果的高亮显示、支持自定义url的字体
  3. 支持url自定义短链接文案
  4. 支持@xxx高亮显示、支持@xxx点击效果的高亮显示、支持自定义@xxx的字体
  5. 支持#xxx#高亮显示、支持#xxx#点击效果的高亮显示、支持自定义#xxx#的字体
  6. 支持自定义的Emoji显示
  7. 支持固定文本的高亮显示
  8. 支持搜索文本的高亮显示
  9. 支持同步、异步绘制
  10. 使用CoreText绘制、可自定义各种富文本样式(行间距、字间距、段间距等)
  11. 支持对超长文案的截断处理 (ps:将超长文案的末尾处理成:"...全文"、并且支持自定义此截断文案)
  12. 支持高亮文案的交互


效果图如下:

圆角背景色
基本使用
自适应高度
截断文案示例


使用方法简单、只需设置对应项的属性值即可:
( 显示富文本使用QARichTextLabel & 异形label使用TrapezoidalLabel )

示例
示例
示例

coretext's People

Contributors

avery-an avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.