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
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: