Android Spinner Layout Issue

Posted on 2011-05-10
Last Modified: 2012-06-27
I have been working in Android for a while but can't figure this one out.

I have a horizontal linear layout that includes two spinners... So far so good.

The first spinner is always offset about 40 dip below the first. No matter what layout I use (TableLayout, LinearLayout etc..) the first spinner is always below the second.

Has anyone seen this behavior before? If so, how can I correct it?

Question by:gdrnec
    LVL 17

    Expert Comment

    by:Dejan Pažin

    Please post the code, so we can see where the problem is.
    LVL 24

    Expert Comment

    from my experience with Android, it is likely to be due to "gravity" or "layout_gravity", but please post your xml so we all can see it
    LVL 4

    Accepted Solution

    I solved it.  

    My apologies to the experts. While I was putting together the code to post here, I found the issue.

    The one spinner that was offset below the other was wrapped in an extra LinearLayout. Once both had the same layout parents, the problem was solved.

    Working with such text based (xml) non compiled indirect code seems to lead to such confusions quite a bit.
    LVL 4

    Author Closing Comment

    This was solved by the asker of the question.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, ( because one time I did this and I essentially had a bricked …
    In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now