2014-10-04 37 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();