问题
How can I target the action bar menu items with ShowCaseView.
I have tried using the following code located here and I am getting ITEM_ACTION_ITEM cannot be resolved or is not a field
How can I target specific ActionBar menu items using ShowCaseView? thanks
ShowcaseView sv = ShowcaseView.insertShowcaseViewWithType(ShowcaseView.ITEM_ACTION_ITEM,
R.id.answers, FragmentViewNovice.this,"Edit",
"Click here to edit image.");
回答1:
For future Googlers, I have found the answer.
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();
来源:https://stackoverflow.com/questions/28224301/targeting-action-bar-menu-items-with-showcaseview