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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:33:34+00:00 2026-05-30T02:33:34+00:00

I have this textField who doing text on center?/////////////////////////////////// textPredmet = [[UITextField alloc] initWithFrame:CGRectMake(20,

  • 0

I have this textField

enter image description here

who doing text on center?///////////////////////////////////

 textPredmet = [[UITextField alloc] initWithFrame:CGRectMake(20, 55, 200, 40)];
    textPredmet.borderStyle = UITextBorderStyleNone;
    textPredmet.textColor = [UIColor blackColor]; //text color
    textPredmet.font = [UIFont systemFontOfSize:15.0];  //font size

    [textPredmet drawTextInRect:CGRectMake( 30,55,200,40)];

    textPredmet.placeholder = @"Введите текст";  //place holder
    textPredmet.backgroundColor = [UIColor clearColor]; //background color
    textPredmet.autocorrectionType = UITextAutocorrectionTypeNo;    // no auto correction support
    textPredmet.keyboardType = UIKeyboardTypeDefault;  // type of the keyboard
    textPredmet.returnKeyType = UIReturnKeyDone;  // type of the return key
    textPredmet.clearButtonMode = UITextFieldViewModeWhileEditing;  // has a clear 'x' button to the right
    textPredmet.delegate = self;    // let us be the delegate so we know when the keyboard's "Done" button is pressed
    textPredmet.background = [UIImage imageNamed:@"input.png"];
    textPredmet.textAlignment=UITextAlignmentLeft+1;
    [self.view addSubview:textPredmet];
  • 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-30T02:33:36+00:00Added an answer on May 30, 2026 at 2:33 am

    Set below line to your code.

    textPredmet.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
    

    It will set the text center vertically.

      textPredmet.textAlignment = UITextAlignmentCenter;
    

    It will set the text center horizontally.

    Also, remove below lines from your code.

    [textPredmet drawTextInRect:CGRectMake( 30,55,200,40)];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this HTML: <input type=text name=textField /> <input type=submit value=send /> How can
I have this and it works: [pole insertObject: [NSString stringWithFormat:@%s,[textfield text]] atIndex:idpole]; But this
I have this models: class Comment(models.Model): text = models.TextField(max_length = 300) author = models.ForeignKey(User)
I have this code -(IBAction) generateFlashNow:(id)sender{ [textField resignFirstResponder]; NSString *string1 = textField.text; //NSString *string2
Okay, I have this textfield form that contains some text. What I need to
I have created a custom tag that looks like this: def textField = {
I have a class that looks like this: public class TextField : TextBox {
I have two models like this: class OptionsAndFeatures(models.Model): options = models.TextField(blank=True, null=True) entertainment =
I have a text field who's value is populated from a SQL recordset (below).
I have a text field that is disabled based on who the user is.

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.