1

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

我尝试使用位于此处的以下代码,我得到了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.");    
4

1 回答 1

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();
于 2015-01-30T11:36:00.590 回答