Multiple non-overlapping views dynamically filling the screen

commando

New Member
I'm trying to have a view with objects on top and on bottom, specifically a textview on top and some seekbars on bottom, and some kind of object in between them to fill the empty space. However, anytime I try to put a view there, it just pushes the lower content off screen.\[code\]<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent" ><View android:id="@+id/under_view" android:layout_width="fill_parent" android:layout_height="fill_parent" ></View><LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout android:id="@+id/text_layout" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="top|center" > <TextView android:id="@+id/text" style="@style/big_bold" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TEXT" android:textColor="#FFFFFFFF" /> </LinearLayout> <!-- insert view here to fill empty space --> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="bottom" android:orientation="vertical" > <!-- or maybe insert view here to fill empty space --> <LinearLayout android:id="@+id/seekbars" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="bottom" android:orientation="vertical" > <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" > <TextView android:id="@+id/text1" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="TEXT" android:textColor="#FFFFFFFF" /> <SeekBar android:id="@+id/seekBar1" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="horizontal" > <TextView android:id="@+id/text2" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center" android:text="TEXT" android:textColor="#FFFFFFFF" /> <SeekBar android:id="@+id/seekBar2" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> </LinearLayout> </LinearLayout></LinearLayout><View android:id="@+id/over_view" android:layout_width="fill_parent" android:layout_height="fill_parent" ></View></FrameLayout>\[/code\]Here is how this currently looks: http://i.stack.imgur.com/9C8nc.png (for some reason even though my reputation is 10 now, it still won't let me post the image)The vertical LinearLayout containing the seekbars actually fills the empty space all the way to the bottom of the upper big text. I'd like to either:[*]fill that middle empty space with a separate view (to attach a touch listener to), or[*]Have the upper big text container stretch all the way down to the flush with the top of the seekbars, but with the text still gravitating at the top. (similar to how the container of the seekbar layout actually fills the entire vertical span up to the big text.)The thing is that I would like to do all of this without setting any dimensions to fixed numbers. I'd like it all to dynamically scale according to the device screen dimensions. I.e. I don't actually care how wide everything is, or how tall the center blank space is. Any suggestions or hints are greatly appreciated. I'm guessing this can be accomplished with the appropriate layout style combination and height/width choices.
 
Back
Top