问题标签 [android-appcompat]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - 使用支持库共享操作提供程序时出现空指针异常
下面是我的 Activity 的代码。在这个我使用支持库 appcompat
}
以下是我的菜单选项 XML 文件,它是一个 ShareActionProvider 小部件
在这我得到一个 NullPointerException 。下面是我的日志猫输出。
android - 主题化 AppCompat ActionBar
我正在尝试通过使用 AppCompat 库来支持低至 API 级别 9 的设备。我正在尝试使用 Google 的示例主题为 ActionBar 设置主题,但它一直告诉我任何名为 android:action* 的项目requires API level 11 (current min is 9)
。我的目标是 18。如果我直接使用示例中的内容,为什么会损坏?谁能帮我弄清楚如何使用 API 级别 9 的 AppCompat 库为 ActionBar 设置主题?
android - 如何使用 SupportLibrary AppcomptV7 添加项目 ActionBar ViewPage Swipe?
这个问题并不像看起来那么复杂。我根据互联网上的一些教程制作了这个设计。在 Honeycomb 可以可视化之前,我使用 SupportLibrary 对设备进行了滑动浏览选项卡式浏览。
现在我想在应用程序中添加一个 ActionBar。也可以使用 SuportLibrary appcompat.v7。
我已经使用 appcompat.v7 创建了一个与旧版本 Android 兼容的带有 ActionBar 的应用程序。
我现在没有得到什么并加入这两个导航结构。
我真的很想用下面的滑动标签添加到这个 mu ActionBar 项目中:
主要活动:
标题适配器:
活动主.xml:
这是迄今为止运行的应用程序的图像。
我希望你能帮助我。
编辑
在 NikolaDespotoski 的指导下,决定仅更改 ActionBarActivity 的扩展类的问题!实际上我在想它必须同时实现这两件事,而没有意识到 ActionBarActivity 已经包含了两者。我的代码看起来像这样,并且有效:
导入android.os.Bundle;导入 android.support.v4.view.ViewPager;导入 android.support.v7.app.ActionBar;导入android.support.v7.app.ActionBarActivity;导入 android.view.Menu;
谢谢!
android - android support v7 appcompat 在 android 2.3v 设备中显示异常,但在 4.2 设备中完美运行
您好,我正在使用 minSDKVersion 8 到 17 使用 Android Navigation Drawer。在程序中,我正在使用操作栏组件来工作导航抽屉。每当在 4.1v android 设备中运行程序时,它都会成功运行,但是当我尝试在 2.3v android 设备中运行相同的程序时,它会显示异常。这是我的详细片段。
MainActivity.java
目录:
AndroidManifest.xml
activity_main.xml
android - 带有列表导航的 Android AppCompat ActionBar 在 API 10 (2.3.3) 上的样式不正确
使用新的 v7 操作栏兼容性库时,我遇到了旧设备上的样式问题。所有样式都搞砸了,例如我正在使用列表导航,并且控制导航的微调器具有默认微调器的圆圈
这是它在 API 10 上的样子:
而这就是它在 API 17 上的样子:
如何让样式匹配?
android - Using support action bar home enabled
I've just modified our code to use the new SupportActionBar provided in the v7-appcompat library but when running the code on a Jellybean phone (presumably the same problem exists for Honeycomb and Ice Cream Sandwich) the home button doesn't ever seem to be activated.
Calling getSupportActionBar().setHomeButtonEnabled(true); doesn't seem to do what it says but works for Gingerbread phones.
If I replace it with getActionBar().setHomeButtonEnabled(true) it does work.
The theme that I use for v11+ is as follows:
And the action bar style v11+ is defined:
Anyone know why the home button is not getting enabled when on an Android version that supports action bar correctly.
=== UPDATE === I've just looked at the source code for the appcompat library and I've noticed the following in ActionBarImplBase which looks wrong to me:
This means that the home button will only be enabled if the Android version is less than ICS or if I've enabled the up indicator? - which I don't want.
android - Android Youtube Player API 活动完成并创建
我们已经使用了适用于 android 的 YouTube API,但是在使用 YouTube 播放器和 YouTube 播放器视图快速关闭和打开相同的活动时存在问题。此问题也出现在示例应用程序中,当我尝试打开Fullscreen
活动(不单击fullscreenbutton
)然后使用后退按钮关闭活动并一次又一次地关闭活动时。
YouTube 应用程序崩溃如下:
10-11 15:14:53.313: E/ActivityThread(22537): Activity com.example.myvideo.FullscreenDemoActivity 已泄露 ServiceConnection com.google.android.youtube.player.internal.r$e@46095818 最初绑定在这里
我试图覆盖OnStop
以释放播放器,但没有积极的结果。请有人帮忙!
Fullscreen
活动修改 - 原始和这个之间的几行区别:
android - 使用 v7 appcompat 库的 Android 向后兼容性
我在 Eclipse 中创建了一个新的 android 项目,并设置了以下配置:
所以,我的应用程序有操作栏。Eclipse 已自动仅包含 android-support-v4.jar。
但是,因为ActionBar class is included in the support library for compatibility with API level 7 and higher.
我想知道为什么在我的项目中只包含 android-support-v4 库。
我想如果我不包含v7 appcompat 库,我可以继续在我的应用程序中显示操作栏,但我无法使用 ActionBar API 管理或自定义它?这是正确的吗?
android - 使用选项卡时操作栏不可见
电话:三星 Galaxy S1
Android:2.3.3
android-support-library:v18
minSdkVersion:7
使用支持库 (appcompat) 将选项卡添加到 ActionBar 时,ActionBar 会消失 -> 片段占用了空白屏幕空间。如果我不向 ActionBar 添加选项卡,则一切正常(ActionBar 可见)。需要做什么才能始终看到 ActionBar。
清单(将 DarkActionBar 添加到活动中):
样式.xml:
片段.xml:
android - 更改操作栏中的操作溢出文本颜色
我一直在努力更改操作栏中“操作溢出”项的文本颜色。我使用带有深色操作栏的 v7 AppCompat 和 Light 主题。
actionMenuTextColor
似乎什么也没做。我需要将其更改为黑色文本吗?有任何想法吗?