【发布时间】:2023-03-10 16:44:01
【问题描述】:
我已将图像文件的本机路径存储到数据库。现在我需要显示该图像。为此,我正在使用
imageView.image = Titanium.Filesystem.getfile(rows.fieldByName('path'));
但是没有效果。 它给出了错误
[ERROR] invalid image type. expected either TiBlob or TiFile, was: NSNull in -[TiUIImageView setImage_:] (TiUIImageView.m:679)
请提出建议。
【问题讨论】:
-
设置 path.extension 扩展名是你使用的任何东西 ex:png,jpg 等
-
警告路径,看看它是否正确。并且,硬编码那个 db 路径,看看它是否有效。
标签: iphone image file titanium