我在操作栏和标签导航方面有一些问题。实际上,我想设置我的制表符在我的行动栏之上。(我用了“神探夏洛克行动条”)。
我看到有些人有问题,因为当他们启用时:
ab.setDisplayShowTitleEnabled(false);标签的表主机是高于他们的ActionBar,但这正是我想要的。这是我的代码:
ActionBar ab = getSupportActionBar();
//getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
ab.setCustomView(R.layout.action_wifisettings);
ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
ab.setDisplayShowTitleEnabled(false);
ab.setDisplayShowHomeEnabled(false);
ab.setDisplayUseLogoEnabled(false);
ab.setDisplayShowCustomEnabled(true);以及对应于我的操作栏的xml文件:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:text="@string/wifi_title"
android:layout_marginLeft="10dp"
android:id="@+id/action_page_title"
android:layout_centerVertical="true"
android:textSize="16sp" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/action_page_title"
android:layout_marginLeft="40dp"
android:textColor="#FFFFFF"
android:layout_centerVertical="true"
android:text="@string/checkbox_title"
android:id="@+id/action_checkbox_wifi"
android:textSize="16sp" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:layout_centerVertical="true"
android:contentDescription="@string/wifi_refresh_desc"
android:background="@drawable/ic_refresh_selector"
android:id="@+id/action_wifi_refresh"
android:textSize="12sp" />
</RelativeLayout>如果你知道如何设置我的动作栏在我的标签后面,那就太棒了。谢谢。
发布于 2013-08-08 08:29:41
我没有找到一个方法来处理操作栏,所以我不得不用我想要的信息来实现我自己的观点。
发布于 2013-11-06 12:08:38
我找到了背景
<item name="displayOptions">homeAsUp|showTitle</item>在你的应用程序主题中,标签放在顶部,尽管在我看来它看起来很糟糕。
https://stackoverflow.com/questions/18061463
复制相似问题