有没有一种非常简单的方法来插入 <hr>
在 UITextView 中分离?
我试过这样的东西,但它不是很漂亮:
[textToInclude appendString:[NSString stringWithFormat:@"________________________________________ \n Total: %0.3f", total]];
[self.myUITextView setText:textToInclude];
最佳答案
最后,由于这个 UITextView 是“只读的”,我使用了一个 UIWebView,这样做:
NSString *contentView = [[NSString alloc] init];
contentView = [NSString stringWithFormat:@"<html><body ><p style=\"color:grey; font-style:italic;\">Some datas</p><hr/><p style=\"font-size:14px;\"> Total: %0.3f </p></body></html>", total];
[self.myUITextView loadHTMLString:contentView baseURL:nil];
[self webViewDidFinishLoad:self.existingEntries];
关于ios - <hr> 在 UITextView 中分离 [iOS],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22481261/