【问题标题】:Using ShowcaseView with the v7 appcompat ActionBar将 ShowcaseView 与 v7 appcompat ActionBar 一起使用
【发布时间】:2013-09-10 15:39:07
【问题描述】:

我正在使用ShowcaseView 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)

有什么方法可以在姜饼上进行这项工作吗?我希望我的应用能够在几乎所有设备上运行,这就是我使用大量支持 API 的原因。

感谢任何帮助!

【问题讨论】:

    标签: android android-layout android-actionbar android-support-library showcaseview


    【解决方案1】:

    简短的回答是“还没有”。在我打字的时候实际工作!在此处查看Github issue 了解更多信息。

    【讨论】:

    • 谢谢,我们会关注进度!
    【解决方案2】:

    固定在this pull request
    请随意分叉

    【讨论】:

      【解决方案3】:

      您可以使用这样的自定义视图:Set Custom Font in the Action Bar

      然后像这样创建新的 ShowcaseView:

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

      【讨论】:

        猜你喜欢
        • 2014-02-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-08-04
        • 1970-01-01
        • 2013-07-28
        相关资源
        最近更新 更多