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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:41:40+00:00 2026-05-26T22:41:40+00:00

I built a simple, once screen android app – it has edittext boxes for

  • 0

I built a simple, once screen android app – it has edittext boxes for username, password etc. This is how it looks in the AVD/Eclipse:

enter image description here

Yet when I deploy it to my HTC Evo 4G, this is how it looks:

enter image description here

In case it matters, Project Build Target is Android 4.0 in Eclipse, but my HTC Evo 4g is running Android 2.3.3. Is that causing this drastic difference? Shouldn’t the layout be backward compatible?

I just realized this:
When I rotate my device to landscape view, I only see the email edittext, but when the device is in portrait, I only see the password edittext (as in the pic above).

Here’s my main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >



    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="40dp"
        android:layout_weight="0.34"
        android:scaleType="center"
        android:src="@drawable/shift" />


    <TextView
        android:id="@+id/txtLogin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginBottom="20dp"
        android:layout_marginTop="20dp"
        android:text="@string/login"
        android:textAppearance="?android:attr/textAppearanceMedium" />

    <FrameLayout
        android:id="@+id/frameLayout1"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" >

        <TextView
            android:id="@+id/txtEmail"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginTop="20dp"
            android:text="@string/email"
            android:textAppearance="?android:attr/textAppearanceSmall" />

        <EditText
            android:id="@+id/txtEmail"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="50dp"
            android:inputType="textEmailAddress" >            
        </EditText>        

        <TextView
            android:id="@+id/txtPass"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginTop="120dp"
            android:text="@string/password"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:hint = "Email address" />

        <EditText
            android:id="@+id/editText2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="150dp"
            android:inputType="textPassword"            
            android:hint="Password"/>


        <Button
            android:id="@+id/btnLogin"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="200dp"
            android:text="Login" />

        <requestFocus/>

    </FrameLayout>

</LinearLayout>
  • 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-26T22:41:40+00:00Added an answer on May 26, 2026 at 10:41 pm

    Upon further research and tinkering around with the UI XML, I realized the problem was that I had most of my controls in a framelayout.

    Now, I’m not sure what exactly a framelayout does but, it seems to stack all controls over each other (and ignores margins). The reason I could only see the Password edittext is because it was placed at the top of the stack of the elements.

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

Sidebar

Related Questions

I have built a simple C#.Net app on a M/C with only .Net FX
I've built a simple .NET 4 custom downloader console app and am finding that
I built a simple social community website for a client - the client would
I've built a simple application that applies grid-lines to an image or just simple
I have built a simple Eclipse plugin where a user may use a TableViewer
I have built a simple menu in jQuery http://vanquish.websitewelcome.com/~toberua/ Here is a sample of
I've built a simple cms with an admin section. I want to create something
Having read Joe Armstrong's book and watched Kevin Smith screencasts I've built a simple
I have built a pretty simple REST service in Sinatra, on Rack. It's backed
I have built a very simple blog application using Ruby on Rails. New to

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.