0
我正在使用DTAttributedTextView以nsstring格式顯示html數據。是否有將此視圖中的文本與中心對齊的方法。如何在DTAttributedTextView中將文本對齊到中心
我正在使用DTAttributedTextView以nsstring格式顯示html數據。是否有將此視圖中的文本與中心對齊的方法。如何在DTAttributedTextView中將文本對齊到中心
我認爲它可以像這樣&完成添加代碼,以IT-
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>"];