ActionBar的Android自定义布局
问题描述:
我创建了一个action_bar.xml布局文件。我在哪里实施可扩展列表视图和2个按钮。如图所示,但问题是整个可扩展列表视图出现在actionBar端。 我的布局文件ActionBar的Android自定义布局
<?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>
我想显示在屏幕康比利的可膨胀的ListView。
答
ExpandableListView
出现在ActionBar中,因为它是使用ActionBar尺寸夸大显示的操作栏自定义布局的一部分。
另一种方法是设定点击侦听器按钮中的一个,然后显示列表视图作为popup control.