Adding custom border around uitextview but little beyond its bounds

北慕城南 提交于 2020-01-02 20:59:37

问题


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.


回答1:


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];



回答2:


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]



回答3:


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



来源:https://stackoverflow.com/questions/8798508/adding-custom-border-around-uitextview-but-little-beyond-its-bounds

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!