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

  • Home
  • SEARCH
  • 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 7045253
In Process

The Archive Base Latest Questions

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

In my application I have thee tabs in the ViewFlipper. When the activity is

  • 0

In my application I have thee tabs in the ViewFlipper.
When the activity is started I initialize all the tabs and the views inside of them.

But the problem is at the 3th tab. On the initialization of this tab, I want to know the distance of an TextView to it parents left side. Therefor I call the TextView.getLeft().

But when this tab isn’t shown I receive ‘0’ from this method. Therefor I can not initialize the view correctly.

Now it becomes strange:
When I start the activity to the first tab, then go to the third, the getLeft return 0 of startup and on tab click….
But when I start the activity to the third tab, the getLeft returns a valid value….

So, how can I get the correct value?
I guess the ViewFlipper doesn’t have the correct X,Y coordinates of views when the tab isn’t shown.

Ps. It was hard to explain. If I need to clarify something, please let me know.

  • 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-28T02:30:30+00:00Added an answer on May 28, 2026 at 2:30 am

    I noticed that the getLeft was called before! the tab actually got executed. (The call was after setDisplayedChild() )

    Therefor I needed to know when the view is actually shown.
    I added an AnimationListener on the InAnimation:

    ViewFlipper.getInAnimation().setAnimationListener(new AnimationListener() {
    
        public void onAnimationStart(Animation animation) {
             TextView.getLeft();
        }
    
        public void onAnimationRepeat(Animation animation) {}
        public void onAnimationEnd(Animation animation) {}
    });
    

    I don’t really like this sollution. But it works.

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

Sidebar

Related Questions

I have a website where drupal manage the contents, but another application handle the
I have an application that uses SmtpClient to send E-Mail, but the E-Mails are
I have an application where I need to parse a string to find all
I have the following problem: I created a iOS 5 SDK application with Storyboard
I see an application have used Log.info = some info where are these logs
In my console application have an abstract Factory class Listener which contains code for
I have one question; In my ASP.NET MVC web application have to do certain
I have an game application I have written for Windows Mobile and I want
I have application which needs to use a dll (also written by me) which
I have application that makes different queries with different results so the caching in

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.