使用ShowcaseView和v7 appcompat ActionBar

5
我正在使用ShowcaseView Android库,在我的应用程序首次启动时添加欢迎屏幕。现在,在Android 4.0+(可能也包括3.0,但我没有设备进行测试)上它可以完美运行,但是在Gingerbread上,应用程序会崩溃并显示以下错误信息。
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)

有没有办法让它在Gingerbread上运行?我希望我的应用程序能够在几乎所有设备上运行,这就是为什么我正在使用大量的支持API的原因。
任何帮助都将不胜感激!
3个回答

6
简短的回答是“还没有”。实际上,我打字时正在解决这个问题!请查看此Github问题以获取更多信息。

谢谢,我会关注进展! - rymate1234

1

0

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

然后创建新的 ShowcaseView:

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接