Android 如何为列表创建操作栏,我正在使用TabLayout创建列表
如何设置操作栏?在java类中,我使用了“公共类ExpandableListMain扩展ExpandableListActivity”。这里我没有使用扩展ActionBarActivity或Activity,我也尝试了这个,我为action bar创建了一个单独的a布局,插入了这个xml代码,它为每个列表创建了单独的action bar,很容易将ActionBarActivity用作基类,并具有与扩展ExpandableListActivity相同的功能 在您自己的类中很容易获得相同的功能,并让它扩展ActionBarActivity作为其基类Android 如何为列表创建操作栏,我正在使用TabLayout创建列表,android,Android,如何设置操作栏?在java类中,我使用了“公共类ExpandableListMain扩展ExpandableListActivity”。这里我没有使用扩展ActionBarActivity或Activity,我也尝试了这个,我为action bar创建了一个单独的a布局,插入了这个xml代码,它为每个列表创建了单独的action bar,很容易将ActionBarActivity用作基类,并具有与扩展ExpandableListActivity相同的功能 在您自己的类中很容易获得相同的功能,并让
选中此项使用工具栏谢谢你的回复Tanks谢谢你的回复我已经在java文件中使用了ExpandableListActivity,但我无法得到正确的结果。我为actionbar创建单独的布局,当我将布局插入上面的TableLayout xml时,它不起作用…将为列表中的每个成员创建单独的actionbar。请参阅我的回答中的链接描述它将帮助您解决问题@SivashankariMoorthy
<?xml version="1.0" encoding="utf-8"?>
<!-- PARENT -->
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="1" android:paddingTop="0dip" android:layout_gravity="top"
>
<TableRow>
<ImageView
android:id="@+id/image"
android:layout_width="50dip"
android:layout_height="50dip"
android:layout_marginLeft="10dip"/>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="1" android:paddingTop="0dip" android:layout_gravity="top"
>
<TableRow>
<TextView
android:id="@+id/text1"
android:textColor="#000000"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1" android:layout_gravity="left|center_vertical"
android:textSize="17dip" android:layout_marginLeft="10dip"
android:textStyle="bold"/>
</TableRow>
</TableLayout>
<ImageView
android:layout_width="25dip"
android:id="@+id/DownArrow"
android:layout_height="25dip"
android:layout_gravity="left|center_vertical"
android:scaleType="centerCrop"
android:background="@drawable/downimage"
/>
</TableRow>