我正在为 Showcaseview 使用 https://github.com/amlcurran/ShowcaseView库
如何制作矩形视图而不是圆形?
以及如何将它用于列表视图项目之一?谢谢
1
我正在为 Showcaseview 使用 https://github.com/amlcurran/ShowcaseView库
如何制作矩形视图而不是圆形?
以及如何将它用于列表视图项目之一?谢谢
1
请参阅CustomShowcaseActivity
示例应用程序中的。它创建了一个矩形展示柜。它定义了CustomShowcaseView
一个构造函数,该构造函数从资源文件dimens.xml设置展示矩形的width
和:height
width = resources.getDimension(R.dimen.custom_showcase_width);
height = resources.getDimension(R.dimen.custom_showcase_height);
与CustomShowcaseActivity
中的 ShowcaseView 相关联Builder
。这也是设置展示目标的地方。
您使用的CustomShowcaseView
工具。它不是抽屉,而是“抽屉”。ShowcaseDrawer
setShowcaseDrawer()
下面显示了这一点,并listview
根据您的需要定位 a:
ViewTarget target = new ViewTarget(R.id.listView, this);
sv = new ShowcaseView.Builder(this)
.setTarget(target)
.setShowcaseDrawer(new CustomShowcaseActivity.CustomShowcaseView(getResources()))
.build();
看看这个:MaterialShowCaseView,它是原始 ShowCaseView 库的改进版本。它有更多的功能,比如sequence
和.withRectangleShape()
。矩形展示的一个例子是:
// single example
new MaterialShowcaseView.Builder(this)
.setTarget(mButtonShow)
.setDismissText("GOT IT")
.withRectangleShape() // this makes it rectangle
.setContentText("This is some amazing feature you should know about")
.setDelay(withDelay) // optional but starting animations immediately in onCreate can make them choppy
.singleUse(SHOWCASE_ID) // provide a unique ID used to ensure it is only shown once
.show();
要将其用于其中一项,请使用 a if
in onBindViewHolder
with specificposition
并简单地显示它。