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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:04:32+00:00 2026-05-22T03:04:32+00:00

i used nested LinearLayouts for the purpose of putting the EditTexts and Buttons in

  • 0

i used nested LinearLayouts for the purpose of putting the EditTexts and Buttons in the center of the screen like this:

Log In Page

I want to change the background of this. So I inserted another LinearLayout on the top of everything else. But its not working. All I can see is black which indicates that I have covered the Editext and Buttons.

I think have to arrange the layouts properly.

any suggestions on how i may put a background(i.e. color, as of now)?

I am posting my xml.

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:background="@+id/OceanBlue">
<LinearLayout 
      android:orientation="vertical"
      android:layout_width="wrap_content">
<LinearLayout
         android:orientation="horizontal"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:gravity="right" >              
        <EditText
             android:id="@+id/et_username"
             android:layout_width="170px"
             android:layout_height="wrap_content"/> 
</LinearLayout>


<LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">           
        <EditText
             android:id="@+id/et_password"          
             android:password="true"
             android:layout_width="170px"
             android:layout_height="wrap_content"/>
</LinearLayout>

<LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">   
        <Button
            android:id="@+id/button_ok"
            android:text="Login"    
            android:layout_width="86px"
            android:layout_height="wrap_content">

        </Button>

        <Button
            android:id="@+id/button_cancel"
            android:text="Cancel">  
         </Button>
</LinearLayout>
</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-22T03:04:33+00:00Added an answer on May 22, 2026 at 3:04 am

    I dont know how you are getting this without specifying any layout_height or layout_width

    Use

    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    

    in your main parent linear layout.I think it will solve your issue.

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

Sidebar

Related Questions

I used to be able to do something like this to get a nested
I've used this useful JQuery function that serializes nested elements. the problem is how
I have a method which used some nested if statements, so I would like
I used the phonegap website to create an IPA file. Now I want to
I am updating a site that has used nested tables to lay out out
As explained in Can regular expressions be used to match nested patterns? , it
Below is stored procedure I have written which used nested cursor. create or replace
From: JavaWorld I understand static may only be used with nested classes and that
I am taking some code that I have used for a nested listview before
Consider the following code. I want to specialize std::hash<> used in a Map ,

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.