I would recommend looking into the source code for the Clock app in
2.1... In the Activity in which the user sets all the options for an
alarm there is code that takes the options preference list and adds a
button bar across the bottom. The Android stock apps [Browser, Email,
SMS, etc] are all available open-source and are great tools for
learning.

But basically what they do in the Clock app is to programmatically
divide up the screen space so your button bar will show on screen with
your ListView.

-Nick




On Apr 16, 11:19 pm, "Er. syed imran ali" <[email protected]> wrote:
> Hi all,
> i tried a lot but i did not success,
> my problem is i want to add first one button and below that one
> listview.
> for that i divided my xml in two Linearlayout as below in code but it
> is not
> working when i am hiding button code then list view is coming other
> wise only
> button is coming on the screen.
> please find out my error in xml or any thing i have to do in .java
> file
>
> my xml code is.
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <LinearLayout
>      xmlns:android="http://schemas.android.com/apk/res/android";
>     android:orientation="horizontal"
>     android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         style="@style/MainBody"
>     >
>
>    <AbsoluteLayout
>     android:layout_width="fill_parent"
>     android:layout_height="80px"
>     android:gravity="top"
>         android:padding="10px"
>     >
>
>      <TextView android:layout_width="fill_parent"
>                 android:layout_height="wrap_content"
>                 android:textColor="#000000"
>                 android:textSize="20sp"
>                 android:layout_x="15px"
>         android:layout_y="10px"
>                  android:textStyle="bold"
>                  android:text="Inspection " />
>
>          <ImageButton android:id="@+id/button_add"
>          android:layout_width="wrap_content"
>      android:layout_height="wrap_content"
>      android:layout_x="175px"
>      android:layout_y="1px"
>      android:background="@drawable/add_plus">
>      </ImageButton>
>
> </AbsoluteLayout>
>
>  <LinearLayout
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>          android:layout_x="10px"
>      android:layout_y="90px"
>         android:padding="10px"
>         android:gravity="bottom"
>     android:background="@drawable/myhelper_border"
>     >
>
>     <ListView android:id="@+id/listview_insp"
>         android:layout_width="fill_parent"
>         android:layout_height="fill_parent"
>         android:layout_x="10px"
>      android:layout_y="190px"
>       android:background="@drawable/myhelper_border"
>          />
>     </LinearLayout>
>
>  </LinearLayout>
>
> Thanks and regards
> Syed Imran Ali
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to