【问题标题】:Targeting action bar menu items with ShowCaseView使用 ShowCaseView 定位操作栏菜单项
【发布时间】:2015-01-29 20:48:13
【问题描述】:

如何使用ShowCaseView.定位操作栏菜单项

我已尝试使用位于here 的以下代码,我得到ITEM_ACTION_ITEM cannot be resolved or is not a field

如何使用 ShowCaseView 定位特定的 ActionBar 菜单项?谢谢

        ShowcaseView sv = ShowcaseView.insertShowcaseViewWithType(ShowcaseView.ITEM_ACTION_ITEM,
            R.id.answers, FragmentViewNovice.this,"Edit", 
           "Click here to edit image.");    

【问题讨论】:

    标签: android showcaseview


    【解决方案1】:

    对于未来的 Google 员工,我找到了答案。

    new ShowcaseView.Builder(getActivity())
        .setTarget(new ActionItemTarget(getActivity(), R.id.answers)) //Here is where you supply the id of the action bar item you want to display
        .setContentTitle("Title")
        .setContentText("Description")
        .hideOnTouchOutside()
        .build();
    

    【讨论】:

    • 还有其他选择吗?因为它对我不起作用
    • @Prabhakar 抱歉,这是我找到的唯一解决方案,它对我有用。
    猜你喜欢
    • 2016-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-10
    • 1970-01-01
    • 2014-10-31
    • 2015-12-17
    • 2012-12-19
    相关资源
    最近更新 更多