简体   繁体   中英

ActionBar's Custom layout for Android

I created a action_bar.xml layout file. where have i implement the expandible listview, and 2 buttons. as shown in picture, but the problem is that the whole expandible listview is appearing in the actionBar Side. my layout file

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="fill_vertical"
    android:orientation="horizontal" >

    <Button
        android:id="@+id/button3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:text="Button" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:text="Button" />

    <ExpandableListView
        android:id="@+id/expandableListView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" >
    </ExpandableListView>

</RelativeLayout>

I want to show the expandible listview over the complee screen.

The ExpandableListView appears in the ActionBar because it is part of action bar custom layout which is inflated and displayed withing ActionBar dimensions.

An alternative would be to set a click listener for one of the buttons, and then display the Listview as a popup control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM