Git Product home page Git Product logo

jyimagetextcombine's Introduction

JYImageTextCombine

图文混排 图文并茂 NSAttributedString转html html转NSAttributedString

image

image

概述

本类使用UITextView中添加富文本的方式,实现iOS原生的图文并排功能,可以自由输入图片和文本。

使用方法:

JYImageTextCombineViewController就是一个textView的控制器,将该类拖入项目中

  • 1.修改服务器上传和下载图片的网络接口。

  • 2.设置项目需要的文本字体大小等属性。

      /*
      * oldHtmlString:包含两种标签<div>和<img>两种标签,文本用<div>,图片用"<img src="http://...." style=width:99%/>"表示
      * 每个标签中间没有空格
      * returnBlock:是返回的字符串格式同上
      */
    

数据格式

和后台约定的数据格式:

<div>JackYoung's</div><img src="https://ss0.bdstatic.com/5aV1bjqh_Q23odCf/static
/superman/img/logo/bd_logo1_31bdc765.png" style="width:99%"/>
<div>如果帮到你,给一个🌟🌟🌟🌟🌟哦</div><img src="https://ss0.bdstatic.com
/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png" style="width:99%"/>

jyimagetextcombine's People

Contributors

jackyoung1989 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.