如何将UIImage插入到UITextView中
我正在开发一个可编辑的笔记本类型项目。它随时由一些文本和图像组成。 在 UITextView
中,如果我们将图像添加为子视图,则框架是固定的。但我有可编辑
选项。所以我必须在 UITextView
中将图像保存为 NSString
格式,但它应该在 uipart 中看起来是图像类型。所以请建议我如何处理这个要求。
提前致谢
im working on a editable notebook type project. it consists some text and images at any time.
in UITextView
if we add images as subview the frames are fixed. but i have editable
option. so i must save image as NSString
format in UITextView
, but it should look image type in uipart. so please suggest me how can i handle this requierment.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为你正在要求一些不可能的事情。
如果您需要真正交错文本和图形,UIWebView 是您唯一的答案。但它不可编辑。
I think you're asking for something that's not possible.
If you need to truly interleave text and graphics, UIWebView is about your only answer. But it's not editable.
我知道已经太晚了。
根据我的理解,您可以使用
UIWebView
插入文本和图像。创建一个 HTML 文件并将其放入应用程序包中。将
div或paragraph(HTML中)
的属性设置为contentEditable = "true"
。并加载该文件: -这样,您的
UIWebView
变得可编辑,并且您可以插入文本和图像。编辑:- 请查看此链接:- 将图像添加到 UITextView
I know it's too late.
As per my understanding, you can use
UIWebView
to insert text and images both.Create an HTML file and put it in app bundle. Set the attribute of
div or paragraph(in HTML)
ascontentEditable = "true"
. And load that file:-This way, your
UIWebView
becomes editable and you can insert text and image both.Edit:- Please have a look at this link:- Adding Images to UITextView
解决如下。采用 Scrollview,管理文本视图和文本视图的大小。插入指定尺寸的图像。像textview,image,tetxview,image等等......
感谢您对解决问题的所有支持。
Solved as follows. Taken Scrollview, in that managing size of the textview & inserting image with Specified size. Like textview,image,tetxview, image and goes on...
Thanks for all your support to solve the issue.