在 uitextview 周围添加自定义边框,但几乎超出其范围

发布于 2024-12-25 20:39:45 字数 77 浏览 2 评论 0原文

我如何向 uitextview 添加边框,使其超出其范围。我可以给出边框的位置吗,还是必须添加自定义边框并为其提供位置。任何帮助将不胜感激。

How can i add border to uitextview little beyond its bounds. Can i give the location for border or do i have to add custom border and give position to it.Any help will be appreciated.

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

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

发布评论

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

评论(3

一场春暖 2025-01-01 20:39:46

这是很容易的任务。你必须添加石英核心框架

并编写以下行

CALayer *imageLayer = textView.layer;
[imageLayer setCornerRadius:10];
[imageLayer setBorderWidth:1];
imageLayer.borderColor=[[UIColor lightGrayColor] CGColor];

it's easy task. you have to add quartz core framework

and write the following line

CALayer *imageLayer = textView.layer;
[imageLayer setCornerRadius:10];
[imageLayer setBorderWidth:1];
imageLayer.borderColor=[[UIColor lightGrayColor] CGColor];
七七 2025-01-01 20:39:46

添加“QuartzCore”框架并将其导入到

    #import <QuartzCore/QuartzCore.h>

.h 文件中的

    UITextView *TextView;

HeaderFile 中以设置 TextView 中的边框

   TextView.layer.borderWidth = 1.0f;

   TextView.layer.borderColor = [[UIColor grayColor] CGColor]; //[YounCan Use any Color For Border]

Add "QuartzCore" Framework And Import It in your HeaderFile

    #import <QuartzCore/QuartzCore.h>

in .h File

    UITextView *TextView;

For Setting The Border IN TextView

   TextView.layer.borderWidth = 1.0f;

   TextView.layer.borderColor = [[UIColor grayColor] CGColor]; //[YounCan Use any Color For Border]
洒一地阳光 2025-01-01 20:39:46

这具有非常简单的集成和出色的文本视图自定义: https://github.com/99centsappdevelopment/JSTextView

This has really simple integration and brilliant text view customisation: https://github.com/99centsappdevelopment/JSTextView

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