菜鸟教程小白 发表于 2022-12-13 14:13:45

iphone - UITableView 单元格多行对齐


                                            <p><p>我已经看到这里发布的问题,询问如何左右对齐两个文本 block ,但是如何在多行单元格内整齐地左右对齐整个段落? (例如,如果您单击对齐按钮,MS Word 等会做什么,以便文本的左侧和右侧始终对齐)。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>您还可以创建一个带有标签的自定义单元格,IBOutlet 到此类可以在 github 上下载 <a href="https://github.com/AliSoftware/OHAttributedLabel/" rel="noreferrer noopener nofollow">OHAttributedLabel</a> ,然后试试下面的代码</p>

<pre><code>cell.label.textAlignment = UITextAlignmentJustify;
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于iphone - UITableView 单元格多行对齐,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/11060991/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/11060991/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - UITableView 单元格多行对齐