首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >将选项卡设置在操作栏上

将选项卡设置在操作栏上
EN

Stack Overflow用户
提问于 2013-08-05 15:05:32
回答 2查看 462关注 0票数 0

我在操作栏和标签导航方面有一些问题。实际上,我想设置我的制表符在我的行动栏之上。(我用了“神探夏洛克行动条”)。

我看到有些人有问题,因为当他们启用时:

代码语言:javascript
运行
复制
ab.setDisplayShowTitleEnabled(false);

标签的表主机是高于他们的ActionBar,但这正是我想要的。这是我的代码:

代码语言:javascript
运行
复制
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文件:

代码语言:javascript
运行
复制
<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>

如果你知道如何设置我的动作栏在我的标签后面,那就太棒了。谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-08-08 08:29:41

我没有找到一个方法来处理操作栏,所以我不得不用我想要的信息来实现我自己的观点。

票数 0
EN

Stack Overflow用户

发布于 2013-11-06 12:08:38

我找到了背景

代码语言:javascript
运行
复制
<item name="displayOptions">homeAsUp|showTitle</item>

在你的应用程序主题中,标签放在顶部,尽管在我看来它看起来很糟糕。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18061463

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档