Skip to content

图文混排,居中对齐 #2

@zyj2015216789

Description

@zyj2015216789

你好,正在做富文本解析,想请教一下,一段HTML代码(包含文本和图片,类似<html><p>tesst<img src = "www.youxiaolianjie.com/img.jpp"/></p></html>)利用UITextView的函数解析为NSAttributedString字符串,默认是图片和文本的底部对齐,(尝试添加了css样式令他们居中对齐,但失败了),有什么解决方法吗?ps: 网上找到的资料是nsAttachment属性的baselineOffset属性也尝试了,但是nsAttachment此时的image.size是0, nsAttachment解析时还没有正式下载图片,所以并不知道图片的具体尺寸,所以偏移量无法计算。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions