做一个详情页,页面方一个 textView 或者 Label
呈现出下面的格式:
应该怎么做,在数据库中存贮怎么样的数据类型(格式), 再通过什么方法解析,求教!
html 只能由 webview 解析吗
PHPz2017-04-17 18:00:12
In fact, just use 4 labels, and each one is related. The database type must be a character type. You can also use plastic surgery if you want, and then convert it. I will give you a piece of my code for reference:
model.pid = [NSString stringWithFormat:@"%d",[rs intForColumn:@"pid"]];
model.pcount = [NSString stringWithFormat:@"%d",[rs intForColumn:@"pcount"]];
model.pname = [rs stringForColumn:@"pname"];
In terms of analysis, I only know webview
PHP中文网2017-04-17 18:00:12
There is a simple and crude method, which is to layout through 4 UILabel
controls.
The indentation of the first line of the text content can be replaced by two full-width spaces.
大家讲道理2017-04-17 18:00:12
Use label.attributedText
.具体怎么用,请参考#import <UIKit/NSAttributedString.h>