扫码关注官方订阅号
做一个详情页,页面方一个 textView 或者 Label
呈现出下面的格式:
应该怎么做,在数据库中存贮怎么样的数据类型(格式), 再通过什么方法解析,求教!
html 只能由 webview 解析吗
认证0级讲师
其实就用4个label,每个关联起来.数据库类型肯定是字符型类型啊,你想有整形也可,到时候转化一下.给你一段我的代码参考一下:
model.pid = [NSString stringWithFormat:@"%d",[rs intForColumn:@"pid"]]; model.pcount = [NSString stringWithFormat:@"%d",[rs intForColumn:@"pcount"]]; model.pname = [rs stringForColumn:@"pname"];
解析的话我也只知道webview
有个简单粗暴的方法, 通过4个UILabel控件进行布局.正文内容的首行缩进可以用两个全角的空格来代替.
UILabel
用 label.attributedText.具体怎么用,请参考#import <UIKit/NSAttributedString.h>
label.attributedText
#import <UIKit/NSAttributedString.h>
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
其实就用4个label,每个关联起来.数据库类型肯定是字符型类型啊,你想有整形也可,到时候转化一下.给你一段我的代码参考一下:
解析的话我也只知道webview
有个简单粗暴的方法, 通过4个
UILabel控件进行布局.正文内容的首行缩进可以用两个全角的空格来代替.
用
label.attributedText.具体怎么用,请参考#import <UIKit/NSAttributedString.h>