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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:03:13+00:00 2026-05-23T13:03:13+00:00

I have layout included inside another layout , I want this included one aligned

  • 0

I have layout included inside another layout , I want this included one aligned bottom when I include it

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="fill_parent">

<Button 
        android:text="Enter Piano course" 
        android:id="@+id/btnEnterCourse" 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"></Button>

<include 
                layout="@layout/powered_by_bar"></include>
</LinearLayout>

in this code sample I want to align powered_by_bar to the bottom of the interface

  • 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-23T13:03:14+00:00Added an answer on May 23, 2026 at 1:03 pm

    In a vertical LinearLayout you cannot align at bottom (or at top) but left or right. In horizontal LinearLayout you can align bottom and top but not left or right.

    To do that you have to wrap the inner LinearLayout in a horizontal LinearLayout and set the layout_weight and layout_gravity correctly:

        <?xml version="1.0" encoding="utf-8"?>
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                android:orientation="vertical" android:layout_width="fill_parent"
                android:layout_height="fill_parent">
    
                <Button android:text="Enter Piano course" 
                        android:id="@+id/btnEnterCourse" 
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"></Button>
    
                <LinearLayout android:layout_weight="1" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent" >
                        <LinearLayout android:background="#0000ff" android:layout_gravity="bottom" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="30dip" />
                </LinearLayout>
        </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have one layout file => res/layout/item.xml : <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android
I have the following layout buttons.xml <?xml version=1.0 encoding=UTF-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/buttonsLayout android:layout_width=fill_parent android:layout_height=wrap_content
I have a layout with two children one after another, like this: |<view1><text1> |
I have a view which include another one with the include component (see http://android-developers.blogspot.com/2009/02/android-layout-tricks-2-reusing-layouts.html
I have a layout like this in which I want to display a label
I have a custom LinearLayout . Inside that layout I want to place a
so I have my main layout as such: <div class=menu> <?php include('/menu.php'); ?> </div>
Good day, I have a requirement which i need to include a layout (actually
I have this layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=match_parent android:layout_height=wrap_content android:orientation=horizontal android:gravity=left> <LinearLayout android:layout_width=wrap_content android:layout_height=wrap_content android:orientation=horizontal>
I have a layout which looks like this: <LinearLayout> <ImageView> android:width=wrap_content android:height:wrap_content ... </ImageView>

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.