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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:33:47+00:00 2026-05-20T20:33:47+00:00

Big picture: This is what I am trying to accomplish. Send a text message

  • 0

Big picture: This is what I am trying to accomplish. Send a text message to someone. The UI/UX should look something similar to this:
enter image description here

So, currently, I am using UITableView with 3 cells. The first two (for “To:” and “From:”) are 44px high. I put a UITextField inside the “contentView” of a UITableViewCell. Everything is good. I can get the user to edit the content of the cell.

Now, I am using the leftView property to display a UILabel with text “To:”. It works but the “To” label is always on the very left of the UITextField (shown in img below):
enter image description here

So, according to the SDK documentation. The left view mode is dictated by this method:
leftViewRectForBounds:

According to the discussion:

You should not call this method
directly. If you want to place the
left overlay view in a different
location, you can override this method
and return the new rectangle.

So, I tried overriding without much success. If anyone have any code snippets, I would greatly appreciate it. In the bottom picture, I set the “From” to be ” From” which is “hacking” it a little bit but I would like to do it correctly. This is what I have tried:

// override leftViewRectForBounds method:
- (CGRect)leftViewRectForBounds:(CGRect)bounds{
    CGRect leftBounds = CGRectMake(bounds.origin.x + 30, 0, 45, 44);
    return leftBounds;
}

and small variants of it and it doesn’t seem to work so any help is appreciated. Thanks!!!

  • 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-20T20:33:48+00:00Added an answer on May 20, 2026 at 8:33 pm

    you could have your class something like below

    @interface MyTextField : UITextField
    {
       //Declare your variable  here    
    }
    @end
    
    @implementation MyTextFiled
    
    // override leftViewRectForBounds method:
    - (CGRect)leftViewRectForBounds:(CGRect)bounds{
        CGRect leftBounds = CGRectMake(bounds.origin.x + 30, 0, 45, 44);
        return leftBounds;
    }
    

    Use MyTextField instead of UITextField.

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

Sidebar

Related Questions

In the big picture, I'm trying to implement Dijkstra's algorithm using a priority queue.
This is a big-picture question... but I also have details on the problem I
This is a very difficult problem to describe. The big picture: An ajaxed dialog
I'm currently trying to create a gallery of pictures loaded from Internet. I'm using
Hi I'm trying to achieve what this website does with their big black and
Somehow I can't see to make it work.. I'm trying to send the picture
I want to fadeOut the current big picture in the #inner_left div by clicking
I'm just looking a big picture idea here; I can google specifics once provided
For big software, take notes is useful for understanding the big picture. How you
The picture shows these little gaps. The big, blue containers between the gaps are

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.