菜鸟教程小白 发表于 2022-12-12 18:02:02

iphone - 我需要渲染文本,但不是在 UIWebView


                                            <p><p>我看了很多,但找不到好的文本渲染解决方案。就我而言,uiwebview 不能满足我的需求。此外,文本必须使用多种字体。我希望它像在 iBooks 中一样,文本呈现得非常快(不像在 uiwebview 中)或者它可能是 uiwebview,但是他们如何做到快速加载呢?</p>

<p>文本还应支持文本选择和其他用户交互。</p>

<p>我愿意接受建议,在此先感谢!</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>你可以看看<a href="https://github.com/Cocoanetics/NSAttributedString-Additions-for-HTML" rel="noreferrer noopener nofollow">NSAttributedString-Additions-for-HTML</a> ,它从 HTML 创建 <code>NSAttributedString</code>,并在 <a href="https://github.com/mattt/TTTAttributedLabel" rel="noreferrer noopener nofollow">TTTAttributedLabel</a> (或 <a href="https://github.com/AliSoftware/OHAttributedLabel" rel="noreferrer noopener nofollow">OHAttributedLabel</a> ),支持 <code>NSAttributedStrings</code> 的 <code>UILabel</code> 的直接替代品。</p></p>
                                   
                                                <p style="font-size: 20px;">关于iphone - 我需要渲染文本,但不是在 UIWebView,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/7899102/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/7899102/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - 我需要渲染文本,但不是在 UIWebView