Tag: android actionbar

Action Bar和新推出的Toolbar有什么区别?

在Google介绍Material Design之后,我听说过一个叫做Toolbar的新的控件类。 什么是工具栏,和ActionBar和ToolBar之间的确切区别是什么?

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

Action Bar兼容性已经添加到支持库,修订版本18中。它现在有ActionBarActivity类,用于在较旧版本的Android上使用Action Bar创build活动。 有没有什么办法可以将支持库中的Action Bar添加到PreferenceActivity ? 以前我用过ActionBarSherlock ,它有SherlockPreferenceActivity 。

如何更改android操作栏的标题和图标

我正在尝试在Android的ActionBar上做一些事情。 我已经在操作栏的右侧添加了新项目。 我如何更改操作栏的左侧? 我想更改图标和文本,我想在其他屏幕的操作栏中添加“后退button”

如何在Android Fragments中添加操作栏选项菜单

我想在Android Fragments中有一个选项菜单。 ActionBar选项菜单不显示在我的片段。 这里是我的代码,我有onCreateOptionsMenu()和onOptionSelected()函数。 我的代码不显示任何错误。 但是选项菜单不显示。 package org.reachout; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import org.general.R; public class ViewMessageFragment extends Fragment { /* (non-Javadoc) * @see android.support.v4.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle) */ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // We have different […]

在Android 4.0+上移除操作栏左侧图标的填充

我想在标准的Android 4.0+操作栏左边的图标周围删除填充。 我正在设置图标: getActionBar().setIcon(getResources().getDrawable(R.drawable.ic_action_myapp)); 我希望图标垂直填充空间,触摸顶部和底部,类似于soundcloud应用程序所做的:

上下文操作栏样式

我在“上下文操作”栏(CAB)上查找样式信息。 我只是需要改变文字的颜色 正如你可以从上面看到的,这是使用标准的Theme.Holo.Light.DarkActionBar主题,所以我只需要设置文本颜色为白色! 任何人都可以指向正确的方向吗?

在ActionBar的主页图标和标题之间填充

有谁知道如何在ActionBar的主页图标和标题之间设置填充?

Android:如何将ActionBar“Home”图标更改为应用程序图标以外的其他内容?

我的应用程序的主图标由两个部分组成:一个图标和一个下面的几个字母。 这适用于应用程序的启动器图标,但是当图标出现在ActionBar的左边缘时,这些字母被切断,看起来不太好。 我想为ActionBar提供一个单独的图标版本,只有“标识”部分,而不是下面的字母,但到目前为止已经空了。 我真的找不到任何答案,我什至不能find问题本身。

在Action Bar下的ProgressBar

问题摘要:如何在ActionBar集成ProgressBar ,就像在Chrome App上一样? 详情:从Chrome浏览器截图: 我想创build一个Action Bar就像这样。 就在操作栏下方,有一个ProgressBar按照页面加载进行填充。 我从很多应用程序中看到过这个例子,比如Feedly,但是我还没有能够创build自己的实现。 我尝试使用Android自己的API来创build它: @Override protected void onCreate(Bundle savedInstanceState) { //Request Permission to display the Progress Bar… this.requestWindowFeature(Window.FEATURE_PROGRESS); this.setWindowContentView(R.layout.activity_main) super.onCreate(savedInstanceState); this.setProgressBarIndeterminate(true); } 但是这个代码只会导致ProgressBar在Action Bar上显示,如下所示: 那么,如何让我的ProgressBar出现在操作栏下,就像Chrome应用程序一样?

ActionBarSherlock堆叠的行动酒吧造型问题

我无法弄清楚为什么堆叠的ActionBar我已经实现了最左边的选项卡和屏幕边缘之间的差距。 最右边的标签不是这种情况。 我尝试通过deviseActionBar来删除分隔ActionBar 。 在玩了一些样式之后,似乎我可以覆盖TabView样式的属性,而不是ActionBarSherlock的TabBar样式。 <style name="ActionBarTabBarStyle.Dark" parent="@style/Widget.Sherlock.ActionBar.TabBar"> <item name="android:divider">@null</item> <item name="android:showDividers">none</item> <item name="android:dividerPadding">0dip</item> </style> 然后我意识到我需要包括相同的前置属性。 ActionBarSherlock主题 Due to limitations in Android's theming system any theme customizations must be declared in two attributes. The normal android-prefixed attributes apply the theme to the native action bar and the unprefixed attributes are for the custom implementation. Since […]