针对与ShowCaseView操作栏菜单项(Targeting action bar menu it

2019-10-21 17:56发布

我怎么可以针对与操作栏菜单项ShowCaseView。

我曾尝试使用位于下面的代码在这里和我得到ITEM_ACTION_ITEM cannot be resolved or is not a field

我如何可以针对使用ShowCaseView特定的动作条菜单项? 谢谢

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

Answer 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();


文章来源: Targeting action bar menu items with ShowCaseView