Home  >  Q&A  >  body text

ios - 显示文本格式的问题

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

呈现出下面的格式:

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

html 只能由 webview 解析吗

PHP中文网PHP中文网2713 days ago437

reply all(3)I'll reply

  • PHPz

    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

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 18:00:12

    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.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 18:00:12

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

    reply
    0
  • Cancelreply