我正在使用DTAttributedTextView以nsstring格式显示html数据。有没有办法将此视图中的文本与中心对齐。
答案 0 :(得分:0)
我认为可以这样做&将代码添加到其中 -
NSMutableString *html = [[NSMutableString alloc] initWithCapacity:1];
[html appendString:@"<html><head>"];
[html appendString:@"<style type=\"text/css\">"];
[html appendString:@"body {"];
[html appendString:@"<center>"];
[html appendString:@"background-color: transparent;"];
[html appendString:@"color: white;"];
[html appendString:@"}"];
[html appendString:@"<center>"];
[html appendString:@"</style>"];
[html appendString:@"</head>"];
[html appendString:@"</body></html>"];