我正在使用https://github.com/amlcurran/ShowcaseView库进行展示视图。
如何制作矩形视图而不是圆形?
如何将其用于列表视图项目之一?
谢谢。
1
我正在使用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
与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();
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();
如果要将其用于其中一个项目,请在onBindViewHolder
中使用if
,并显示特定的position
。