Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7050303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:07:38+00:00 2026-05-28T03:07:38+00:00

I am trying to add border around UITextView by using self.textView.layer.borderWidth = 1; self.textView.layer.borderColor

  • 0

I am trying to add border around UITextView by using

 self.textView.layer.borderWidth = 1;

  self.textView.layer.borderColor = [[UIColor brownColor] CGColor];  

but it is not showing up. If anyone can help me with why it is not showing up. Eventhough i have added Quartz framework. But still is not showing up.

#import "uitextviewViewController.h"
#import <QuartzCore/QuartzCore.h>


@implementation uitextviewViewController

@synthesize textView;
@synthesize navBar;


- (void)dealloc {

[navBar release];
    [textView release];

[super dealloc];
 }


- (void) viewDidLoad
{
   [super viewDidLoad];

  UIBarButtonItem * button = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
                                                                         target:self
                                                                         action:@selector(done:)];
[[self navigationItem] setRightBarButtonItem:button];
[button release];

self.textView = [[[UITextView alloc] initWithFrame:self.view.frame] autorelease];

self.textView.textColor = [UIColor whiteColor];

self.textView.font = [UIFont fontWithName:@"Arial" size:15];

self.textView.delegate = self;

self.textView.backgroundColor = [UIColor brownColor];

self.textView.layer.borderWidth = 1;

self.textView.layer.borderColor = [[UIColor brownColor] CGColor];

self.textView.textAlignment =  UITextAlignmentCenter;

self.textView.text = @"This is UITextView\n\nThis is UITextView\n\nThis is UITextView\n\nThis is UITextView\n\nThis is UITextView."; 

self.textView.scrollEnabled = YES;
[self.view addSubview: self.textView]; 

}

I will appreciate help.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:07:38+00:00Added an answer on May 28, 2026 at 3:07 am

    Here, use this.

    Modify it as you’d like.

    UITextFieldWrapper.h

    #import <UIKit/UIKit.h>
    
    @interface UITextFieldWrapper : UIView
    
    @property (nonatomic, weak, readonly) UITextField * textField;
    
    @end
    

    UITextFieldWrapper.m

    #import "UITextFieldWrapper.h"
    #import <QuartzCore/QuartzCore.h>
    
    @implementation UITextFieldWrapper
    
    @synthesize textField = _textField;
    
    - (id)initWithFrame:(CGRect)frame
    {
        self = [super initWithFrame:frame];
        if (self) {
            self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
            self.layer.borderWidth = 1.0;
            self.layer.borderColor = [[UIColor blackColor] CGColor];
            self.backgroundColor = [UIColor whiteColor];
            self.clipsToBounds = YES;
    
            UITextField * textField = [[UITextField alloc] initWithFrame:CGRectMake(3, 3, frame.size.width - 6, 21)];
            textField.backgroundColor = [UIColor whiteColor];
            [self addSubview:textField];
            _textField = textField;
        }
        return self;
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add a curved border around an image downloaded and to
I am trying to add a border att tha bottom of my textrured window
I'm trying add a tab to my web page that looks like this: Using
Im trying to add a directory foo to my repo, but there are some
I am trying to add a border and padding to the table row of
I'm trying to add 3 panels to the border layout only North South and
I am trying to add a bottom border to a div .divLast { top:
I am trying to figure out how to add a border only inside the
I'm trying to add an icon which sits on top of the border, splitting
I'm trying to add css styling to Facebook Like Box XFBML file but it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.