首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Android展示视图如何使用?

Android展示视图如何使用?
EN

Stack Overflow用户
提问于 2014-03-03 08:25:14
回答 5查看 22.9K关注 0票数 4

好的展示视图

我用这个:

https://github.com/amlcurran/ShowcaseView

导入文件后,会产生错误。这是我的错误和改进的.jar文件

错误说

在爪哇

不能将r解析为变量。

风格化

错误:错误检索父项:没有找到与给定名称“Theme.Sherlock.light”匹配的资源。

再次,在风格上

错误:错误:没有找到与给定名称匹配的资源: attr 'android:fontFamily‘。

还有什么教程可以在我的项目中使用Showcase视图。我找不到,也不支持github项目。还不清楚。

EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2018-10-03 04:49:31

这个库对所有人都很好。它是如何工作的??我想突出显示工具栏选项。现在,只需添加库并编写如下代码。

可以使用以下代码使用多个showCaseView

1 添加库在Gradle.build 实现'com.github.mreram:ShowCaseView:1.0.5‘

简单地调用此方法,并使用PASTHO标题、描述文本、视图或视图Id和类型

代码语言:javascript
复制
  ShowIntro("SetTheme", "Select Theme and Apply on your video", R.id.button_tool_theme, 1);

方法创建如下所示

代码语言:javascript
复制
 private void ShowIntro(String title, String text, int viewId, final int type) {

    new GuideView.Builder(this)
            .setTitle(title)
            .setContentText(text)
            .setTargetView((LinearLayout)findViewById(viewId))
            .setContentTextSize(12)//optional
            .setTitleTextSize(14)//optional
            .setDismissType(GuideView.DismissType.targetView) //optional - default dismissible by TargetView
            .setGuideListener(new GuideView.GuideListener() {
                    @Override
                    public void onDismiss(View view) {
                        if (type == 1) {
                            ShowIntro("Editor", "Edit any photo from selected photos than Apply on your video", R.id.button_tool_editor, 6);
                        } else if (type == 6) {
                            ShowIntro("Duration", "Set duration between photos", R.id.button_tool_duration, 2);
                        } else if (type == 2) {
                            ShowIntro("Filter", "Add filter to video ", R.id.button_tool_effect, 4);
                        } else if (type == 4) {
                            ShowIntro("Add Song", "Add your selected song on your video ", R.id.button_tool_music, 3);
                        } else if (type == 3) {
                            ShowIntro("Overlay", "Add your selected overlay effect on your video ", R.id.button_tool_overlay, 5);
                        } else if (type == 5) {
                            SharePrefUtils.putBoolean("showcase", false);
                        }
                    }
                })
            .build()
            .show();
}
票数 12
EN

Stack Overflow用户

发布于 2017-08-17 19:17:55

在这里,我使用这个库

https://github.com/amlcurran/ShowcaseView

这个图书馆工作得很好。它是如何工作的??假设我想突出显示一个菜单选项。现在,只需添加库,并白色这段代码。

代码语言:javascript
复制
    Toolbar toolbar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.inflateMenu(R.menu.menu_main);
    setSupportActionBar(toolbar);

    ViewTarget target = new ViewTarget(toolbar.findViewById(R.id.menu_id_launcher));

    new ShowcaseView.Builder(this)
            .setContentTitle("Its My Navigation Drawer")
            .setContentText("Click here and you will get options to navigate to other sections.")
            .useDecorViewAsParent() //this is the difference
            .setTarget(target)
            .build();
}

最后,你必须让你的菜单显示像这样

代码语言:javascript
复制
    <item
      android:id="@+id/menu_id_launcher"
      android:orderInCategory="100"
      android:icon="@mipmap/ic_launcher"
      android:title="@string/action_settings"
      app:showAsAction="always" />

现在,运行应用程序,我认为这将是完美的工作。

票数 2
EN

Stack Overflow用户

发布于 2018-11-14 15:40:59

我通常使用另一个库来展示视图。它会产生气泡而不是同心圆,但效果确实很好。也许它对您的需求也是有用的,使用此需求时,您不会遇到导入问题。

您只需在应用程序的'com.elconfidencial.bubbleshowcase:bubbleshowcase:1.3.0‘文件中添加“implementation’com.elconfidencial.bubbleshowcase:bubbleshowcase:1.3.0‘”,并同步项目即可。

它的工作原理类似于ShowCaseView库:

代码语言:javascript
复制
BubbleShowCaseBuilder(this) //Activity instance
            .title("foo") //Any title for the bubble view
            .targetView(view) //View to point out
            .show() //Display the ShowCase

https://github.com/ECLaboratorio/BubbleShowCase-Android

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22141856

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档