UITextView的背景图片 [英] Background Image for UITextView

查看:136
本文介绍了UITextView的背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法为UITextView实现背景图像。我遇到的问题是实际的文本是一个未知的大小,背景图像滚动,然后变成白色屏幕。如何让背景图像与textView的大小相同?我通过Storyboard设置了背景图像,并通过代码将子视图添加到textView。

I am having trouble implementing a background image for a UITextView. The problem I am having is that the actual Text is of an unknown size and the background image scrolls and then becomes white screen. How can I have the background image be the same size of the textView? I have the background image set via Storyboard and add subviews to the textView via code.

推荐答案

使用 resizableImageWithCapInsets:将图像拉伸为与TextView一样大。

Use resizableImageWithCapInsets: to "stretch" your image to be as big as your TextView.

这篇关于UITextView的背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆