gpt4 book ai didi

android - 如何在 ListView 的展示 View 中制作矩形 View

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:15:17 25 4
gpt4 key购买 nike

我正在使用 https://github.com/amlcurran/ShowcaseView Showcaseview 库
如何制作矩形 View 而不是圆形 View ?
以及如何将它用于 ListView 项目之一?谢谢

1

最佳答案

引用CustomShowcaseActivity在示例应用程序中。它创建了一个矩形展示柜。它定义了一个 CustomShowcaseView 和一个构造函数,该构造函数从资源文件 dimens.xml 中设置展示矩形的 widthheight :

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

CustomShowcaseActivityBuilder 中的 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com