Sunday, 1 March 2015

Set bottom gravity to a single view Android



I have a horizontal linear layout, with 3 buttons, on the display. I want this layout to be displayed in the bottom of the display.


Here is the code I wrote:



<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
xmlns:tools="http://ift.tt/LrGmb4" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context="flowepower.tetris.Game"
android:background="@drawable/Main_screen">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal"
</LinearLayout> </RelativeLayout>


I haven't put the buttons code, they are simple ones.


With this code, it is still displayed on the top. Can you suggest me other posibilities? Thank you!


No comments:

Post a Comment