gpt4 book ai didi

Objective-C 中的 HTML 字符串

转载 作者:行者123 更新时间:2023-11-27 23:53:27 25 4
gpt4 key购买 nike

我有一个加载 HTML 字符串的 Web View 。代码在

[self.wvAttributes loadHTMLString:[product.additional_Info stringByReplacingOccurrencesOfString:@"\n" withString:@"<br/>"] baseURL:nil];

结果如下: enter image description here

我想将此文本右对齐,我不擅长 Objective-C,所以请帮助我做到这一点。

提前致谢。

最佳答案

您应该更改 css 中的文本对齐方式。如果您无权访问 css 文件,请尝试此操作

NSString *htmltring = [product.additional_Info stringByReplacingOccurrencesOfString:@"\n" withString:@"<br/>"];
htmltring = [htmltring stringByReplacingOccurrencesOfString:@"text-align: left" withString:@"text-align: right"];
[self.wvAttributes loadHTMLString:htmltring baseURL:nil];

关于Objective-C 中的 HTML 字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56399935/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com