我正在使用 https://github.com/amlcurran/ShowcaseView Showcaseview 库
如何制作矩形 View 而不是圆形 View ?
以及如何将它用于 ListView 项目之一?
谢谢
1
最佳答案
引用CustomShowcaseActivity
在示例应用程序中。它创建了一个矩形展示柜。它定义了一个 CustomShowcaseView
和一个构造函数,该构造函数从资源文件 dimens.xml 中设置展示矩形的 width
和 height
:
width = resources.getDimension(R.dimen.custom_showcase_width);
height = resources.getDimension(R.dimen.custom_showcase_height);
CustomShowcaseActivity
与 Builder
中的 ShowcaseView 关联。这也是设置展示目标的地方。
CustomShowcaseView
实现了 ShowcaseDrawer
,因此您可以使用 setShowcaseDrawer()
。它不是抽屉,而是“抽屉 - 呃”。
下面显示了这一点,并根据需要将 listview
作为目标:
ViewTarget target = new ViewTarget(R.id.listView, this);
sv = new ShowcaseView.Builder(this)
.setTarget(target)
.setShowcaseDrawer(new CustomShowcaseActivity.CustomShowcaseView(getResources()))
.build();
关于android - 如何在 ListView 的展示 View 中制作矩形 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26192620/