ios - 显示文本格式的问题
PHP中文网
PHP中文网 2017-04-17 17:58:12
0
3
466

做一个详情页,页面方一个 textView 或者 Label

呈现出下面的格式:

应该怎么做,在数据库中存贮怎么样的数据类型(格式), 再通过什么方法解析,求教!

html 只能由 webview 解析吗

PHP中文网
PHP中文网

认证0级讲师

reply all(3)
PHPzhong

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

Ty80

There is a simple and crude method, which is to layout through 4 UILabelcontrols.
The indentation of the first line of the text content can be replaced by two full-width spaces.

大家讲道理

Use label.attributedText.具体怎么用,请参考#import <UIKit/NSAttributedString.h>

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template