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 9225159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:30:34+00:00 2026-06-18T04:30:34+00:00

I would like to create a custom UITextView with the ability to enter text

  • 0

I would like to create a custom UITextView with the ability to enter text in it, as well as programmatically adding some UILabels there that would act like text (I need to delete them with the ‘backspace’ button when the cursor comes near them).

This UITextView should be expandable and the labels can have different width.

Any ideas of how you can create this sort of thing, any tutorials or such?

  • 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-06-18T04:30:35+00:00Added an answer on June 18, 2026 at 4:30 am

    you can create textfield using this code.

    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 200, 300, 40)];
    textField.borderStyle = UITextBorderStyleRoundedRect;
    textField.font = [UIFont systemFontOfSize:15];
    textField.placeholder = @"enter text";
    textField.autocorrectionType = UITextAutocorrectionTypeNo;
    textField.keyboardType = UIKeyboardTypeDefault;
    textField.returnKeyType = UIReturnKeyDone;
    textField.clearButtonMode = UITextFieldViewModeWhileEditing;
    textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;    
    textField.delegate = self;
    [self.view addSubview:textField];
    [textField release];
    

    And for creating label you can use this code:

    CGRect labelFrame = CGRectMake( 10, 40, 100, 30 );
        UILabel* label = [[UILabel alloc] initWithFrame: labelFrame];
        [label setText: @"My Label"];
        [label setTextColor: [UIColor orangeColor]];
        label.backgroundColor =[UIColor clearColor];
        [view addSubview: label];
    

    and for deleting label when backspace tape use this method:

    - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    if ([string isEqualToString:@""]) {
    NSLog(@"backspace button pressed");
    [label removeFromSuperview];
    }
    return YES;
    }
    

    If the backspace button is pressed, then the replacementString(string) will have null value. So we can identify backspace button press using this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have authored some custom classes that I would like to create using XAML:
I would like to create some custom UI controls that work with both WPF
I would like to create a custom event in jQuery that captures ENTER onkeypress
I would like create a custom DataRow that will have -let's say- a propery
I would like to create a custom task that is called in a fashion
I would like to create a custom NSView that takes a layered approach to
I would like to create a custom parameter for a vstemplate containing some C#
I would like to create a custom field in django that models an ordinary
In .NET 3.5, I would like to create a custom attribute (say [NetDataMember]) that
I would like to create a custom version of the TabControl so that when

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.