2014-10-04 100 views

回答

0

参考CustomShowcaseActivity在示例应用程序。它创建了一个矩形展柜。它定义了一个CustomShowcaseView与设置width和资源文件dimens.xml陈列柜矩形的height构造:

width = resources.getDimension(R.dimen.custom_showcase_width); 
height = resources.getDimension(R.dimen.custom_showcase_height); 

CustomShowcaseActivity关联到在Builder的ShowcaseView。这也是展示目标设定的地方。

CustomShowcaseView implements ShowcaseDrawer因此您使用setShowcaseDrawer()。这不是一个抽屉,而是一个“抽屉”。

下面显示了这一点,并针对一个listview为你想要的东西:

ViewTarget target = new ViewTarget(R.id.listView, this); 

sv = new ShowcaseView.Builder(this) 
      .setTarget(target) 
      .setShowcaseDrawer(new CustomShowcaseActivity.CustomShowcaseView(getResources())) 
      .build();