How to leave area for future dynamic activity?

absembehoub

New Member
I am trying to figure out how to make my layout have the following coded buttons stay in their place despite future dynamic activity, maybe through reserving a free space. In between the menu button and the other three buttons will be a grid of buttons with both random size and in random amounts based on preselections created dynamically. But no matter how many buttons or the sizes I want these four buttons designed in main.xml to remain in their proper positions.\[code\]<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <Button android:id="@+id/menu" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="MENU" />\[/code\]This is the area of concern. I want to make it where the menu button (above) is always attached to the top of the screen and the step, pause, and simulate buttons (below) are always at the very bottom of the screen.\[code\] <Button android:id="@+id/step" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/grid" android:layout_centerHorizontal="true" android:text="STEP" /> <Button android:id="@+id/pause" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/grid" android:layout_toLeftOf="@id/step" android:text="PAUSE" /> <Button android:id="@+id/sim" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/grid" android:layout_toRightOf="@id/step" android:text="SIMULATE" /> <SeekBar android:id="@+id/speed" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/sim" android:layout_alignParentLeft="true"/></RelativeLayout>\[/code\]I just figured out a solution my own question.I had to use "android:layout_alignParentBottom="true" after the menu button on the other three buttons, now any buttons added dynamically can be placed in between as needed.The website wont let me answer my own question.
 
Back
Top