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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:41:44+00:00 2026-06-09T22:41:44+00:00

In my case to calculate a UILabel frame.origin.x to make it on the right

  • 0

In my case to calculate a UILabel frame.origin.x to make it on the right side with code below:

writerNameLabel.frame = CGRectMake(cell.frame.size.width - writerNameLabel.frame.size.width - 80.......)

NSLog(@" writerNameLabel frame width: %f",writerNameLabel.frame.size.width);
NSLog(@" cell frame width: %f",cell.frame.size.width);
NSLog(@" cell - writerNameLabel frame width: %f",cell.frame.size.width - writerNameLabel.frame.size.width);
NSLog(@" writerNameLabel frame x: %f",writerNameLabel.frame.origin.x);


2012-08-17 14:43:36.895 writerNameLabel frame width: 38.000000
2012-08-17 14:43:36.899 cell frame width: 320.000000
2012-08-17 14:43:36.902 cell - writerNameLabel frame width: 282.000000
2012-08-17 14:43:36.904 writerNameLabel frame x: 240.000000

----

2012-08-17 14:43:36.924 writerNameLabel frame width: 102.000000
2012-08-17 14:43:36.928 cell frame width: 320.000000
2012-08-17 14:43:36.931 cell - writerNameLabel frame width: 218.000000
2012-08-17 14:43:36.934 writerNameLabel frame x: 240.000000

The problem is that this

cell.frame.size.width – writerNameLabel.frame.size.width

part in my calculation doesn’t work, it only return the value of

cell.frame.size.width – 80

, why? Did I do anything wrong?

Please advise. 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-06-09T22:41:45+00:00Added an answer on June 9, 2026 at 10:41 pm

    Because the value of writerNameLabel.frame.size.width is 0 at that time.

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

Sidebar

Related Questions

The code below is used to calculate the miles between two cities. In this
I want to calculate the cell height using code. My text contains html entities
Case with bootstrap: Example code function( $ ){ }( window.jQuery );
The following code calculate the nearest distance in two points. The part if(j==0) is
How can I calculate worst case running time of this loop? for(int i=1 ;
I have a case where I need to calculate x^y a vast number of
I have an edge case. I'm building code that reads binary datafiles produced by
What would be the assembly code for 68HC11 to calculate value of sine using
I wrote this code to calculate the valid day entry---- and in the process
I need to calculate the logical width of a visual element, before it gets

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.