如何使用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.");

最佳答案

对于未来的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();

关于android - 使用ShowCaseView定位操作栏菜单项,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/28224301/

10-08 21:21