使用ShowCaseView定位操作栏菜单项

时间:2015-01-29 20:48:14

标签: android showcaseview

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

1 个答案:

答案 0 :(得分:4)

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