Android UI Libs之ShowcaseView

Android UI Libs之ShowcaseView

1. 说明

ShowcaseView,顾名思义,展柜视图,展示界面上某一部分的作用,一个用来做新手引导与使用说明的最佳第三方库。

2. 配置

在模块中添加依赖:compile 'com.github.amlcurran.showcaseview:library:5.4.3'

3. 使用

ShowcaseView的使用非常简单

 ViewTarget target = new ViewTarget(R.id.target, this);
        new ShowcaseView.Builder(this)
                .withMaterialShowcase()
                .setTarget(target)
                .setContentTitle("ShowcaseView")
                .setContentText("This is highlighting the Home button")
                .hideOnTouchOutside()
                .build();  

《Android UI Libs之ShowcaseView》

  • ViewTarget:是我们要展示的View
  • withMaterialShowcase():设置主题为Material,一共有三种主题
    • Material
    • New style
    • Holo
  • setTarget:设置要展示的View
  • setContentTitle:设置标题
  • setContentText:设置内容
  • hideOnTouchOutside:设置触摸时隐藏

4. 用户注册引导

我做了一个简单的用户注册引导界面:

《Android UI Libs之ShowcaseView》

程序源代码下载:https://github.com/lavor-zl/UILibs

    原文作者:lavor
    原文地址: https://www.jianshu.com/p/c4f226d76952
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞