我怎样才能找到身高和身高? UITextView 的宽度

发布于 2024-12-29 01:30:07 字数 103 浏览 1 评论 0原文

我正在开发 iPhone 应用程序。因为我必须将文本视图内容保存为相册中的图像。我尝试捕获屏幕,但它仅捕获文本视图的可见部分。所以我决定使用textview的高度和宽度来保存。有人可以帮我吗?

I'm developing iPhone app. In that I have to save textview content as image in photo album. I tried to capture the screen but it captured only the visible part of the textview. So I decided to save using textview height and width. Could any one please help me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

婴鹅 2025-01-05 01:30:07

使用 frame 属性怎么样?

self.textview.frame.size.width
self.textview.frame.size.height

What about using the frame property?

self.textview.frame.size.width
self.textview.frame.size.height
倒数 2025-01-05 01:30:07
NSLog("Height : %f Width : %f",textview.frame.size.width,textview.frame.size.height);
NSLog("Height : %f Width : %f",textview.frame.size.width,textview.frame.size.height);
澉约 2025-01-05 01:30:07

你应该做的是将textview层保存到UIImage

What you should do is save the textview layer to a UIImage

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文