标签: android-actionbar

在appcompat-v7中删除工具栏中的标题

文件Toolbar

如果应用使用徽标图片,则应强烈考虑省略标题和副标题.

删除标题的正确方法是什么?

android android-appcompat android-actionbar android-toolbar

161
推荐指数
7
解决办法
11万
查看次数

如何在菜单按钮的设备上强制使用溢出菜单

我想让所有不适合ActionBar的菜单项都进入溢出菜单(从操作栏到菜单按钮),即使在有菜单按钮的设备上也是如此.对于用户而言,这似乎更直观,而不是将它们放入单独的菜单列表中,该列表要求用户从触摸(屏幕)交互跳转到基于按钮的交互,这仅仅是因为ActionBar的布局不能适合他们在栏上.

在模拟器上,我可以将"硬件后退/主页键"值设置为"否"并获得此效果.我已经在代码中搜索了一种方法来实现具有菜单按钮但不能很好的设备的实际设备.谁能帮我?

android android-actionbar

158
推荐指数
6
解决办法
8万
查看次数

ActionBarSherlock和ActionBar兼容性之间的区别

ActionBarSherlockAction Bar兼容性有什么区别

几天前谷歌刚刚发布了令我如此困惑的ActionBar兼容性.操作栏兼容性是否与ActionBarSherlock相同,编码是否相同?

示例:操作栏兼容性是否支持导航"up"或ActionBar.Tab的应用程序图标

java android actionbarsherlock android-actionbar android-actionbar-compat

155
推荐指数
7
解决办法
4万
查看次数

无法在Android studio中加载具有未知错误的AppCompat ActionBar

下面是我的xml文件.在预览中有两个错误"无法加载具有未知错误的AppCompat ActionBar"和"无法实现多个类".怎么能运行app.But应用程序崩溃,在Logcat中没有显示错误.

这是我的预览屏幕截图在此输入图像描述

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">


    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="506dp" />

    <LinearLayout
        android:id="@+id/layout_main"
        android:orientation="vertical"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:weightSum="1"
        tools:context=".Activity.MainActivity">


    <LinearLayout
        android:id="@+id/main_layout"
        android:orientation="vertical"
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="0.7"
        tools:context=".Activity.MainActivity">

        <!-- our tablayout to display tabs  -->
        <android.support.design.widget.TabLayout
            android:id="@+id/tabLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="50dp"
            app:tabMode="scrollable"
            app:tabSelectedTextColor="@color/colorBlack"
            app:tabTextColor="@color/colorWhite"
            android:background="@color/colorOran"
            android:minHeight="?attr/actionBarSize"
            />

        <!-- View pager to swipe views -->
        <android.support.v4.view.ViewPager
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    </LinearLayout>

        <LinearLayout
            android:id="@+id/ll"
            android:layout_width="match_parent"
            android:layout_height="64dp"
            android:layout_alignParentBottom="true"
            android:background="#ffffff"
            android:orientation="horizontal"
            android:layout_weight="0.3"
            android:weightSum="4"
            tools:layout_editor_absoluteX="8dp" …
Run Code Online (Sandbox Code Playgroud)

android android-actionbar

151
推荐指数
9
解决办法
18万
查看次数

从android上的操作栏中删除图标/徽标

我一直试图找到一些从操作栏中删除图标/徽标的方法,但我在搜索SO,Android的文档和Google之后发现的唯一一件事就是如何删除整个标题栏.那不是我想要的.只想从标题栏中删除图标/徽标.

谁知道怎么做到这一点?我想在XML中这样做.

xml android titlebar android-layout android-actionbar

145
推荐指数
10
解决办法
14万
查看次数

像Google一样的Actionbar通知计数图标(徽章)

是否有Android标准徽章或方法来显示带有Google示例的计数的操作栏通知图标?

在图片上数3

如果没有,那么最好的方法是什么呢?
我是android的新手,请帮忙.

notifications icons android actionbarsherlock android-actionbar

142
推荐指数
5
解决办法
11万
查看次数

不推荐使用ActionBarActivity

实际上没有问题.项目编译和运行.但我无法理解什么是三角触发类的名称(Android Studio告诉我们使用了弃用的代码)在此输入图像描述.谁能解释一下?

android deprecated android-actionbar android-studio

136
推荐指数
3
解决办法
11万
查看次数

如何永久禁用操作栏

我可以使用以下代码隐藏蜂窝中的操作栏:

getActionBar().hide();
Run Code Online (Sandbox Code Playgroud)

但是当键盘打开并且用户复制粘贴任何内容时,操作栏会再次显示.如何永久禁用操作栏?

android android-actionbar

131
推荐指数
14
解决办法
26万
查看次数

如何将支持库中的Action Bar添加到PreferenceActivity中?

操作栏兼容性已添加到支持库,修订版18中.它现在具有ActionBarActivity用于在旧版Android上使用操作栏创建活动的类.

有没有办法从支持库添加Action Bar PreferenceActivity

以前我用ActionBarSherlock,它有SherlockPreferenceActivity.

android preferenceactivity android-actionbar android-support-library

128
推荐指数
4
解决办法
4万
查看次数

更改searchview小部件的背景drawable

我正在尝试更改位于Android操作栏searchview小部件中的drawable.

目前它看起来像这样: 在此输入图像描述

但我需要将蓝色背景改为红色.

我尝试过很多东西,不用滚动我自己的搜索小部件,但似乎没有任何工作.

有人能指出我改变这个方向的正确方向吗?

android styles android-actionbar searchview background-drawable

122
推荐指数
5
解决办法
7万
查看次数