将 ShowcaseView 与 v7 appcompat ActionBar 结合使用



我正在使用ShowcaseView android库在我的应用程序首次启动时添加欢迎屏幕。

现在,在

4.0+(可能还有 3.0,但我还没有设备来测试它)上它运行良好,但是在姜饼上,应用程序崩溃并出现以下错误。

09-10 15:30:31.182    1650-1650/net.rymate.notes E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.RuntimeException: insertShowcaseViewWithType cannot be used when the theme has no ActionBar
    at com.github.espiandev.showcaseview.ShowcaseView$2.run(ShowcaseView.java:231)
    at android.os.Handler.handleCallback(Handler.java:587)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3683)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    at dalvik.system.NativeStart.main(Native Method)

有没有办法在姜饼上做到这一点?我希望我的应用程序能够在几乎所有设备上运行,这就是我使用大量支持 API 的原因。

任何帮助不胜感激!

简短的回答是"还没有"。实际上在我打字时正在处理它!查看 Github 问题 此处 了解更多信息。

在此

拉取请求中修复
随意分叉

您可以使用如下自定义视图: 在操作栏中设置自定义字体,

然后创建新的展示视图,如下所示:

ShowcaseView.ConfigOptions co = new ShowcaseView.ConfigOptions();
co.hideOnClickOutside = true;
ShowcaseView sv = ShowcaseView.insertShowcaseView(v, this, 
    "TITLE", "subtitle", co);

最新更新