【问题标题】:Chrome Custom Tabs customisations like setToolbarColor, start and exit animations are not workingChrome 自定义选项卡自定义(如 setToolbarColor、开始和退出动画)不起作用
【发布时间】:2018-12-29 13:58:42
【问题描述】:

我是 Android 新手,正在尝试在 Chrome 自定义选项卡中打开链接。我创建了一个功能,可以在 Chrome 自定义选项卡中打开应用程序上的任何链接:

public static void chromeCustomTab(Context context, String url)
{
    CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
    CustomTabsIntent customTabsIntent = builder.build();
    customTabsIntent.launchUrl(context,Uri.parse(url));
    builder.setToolbarColor(context.getResources().getColor(R.color.colorPrimaryDark));
    builder.setStartAnimations(context, R.anim.slide_in_bottom, R.anim.slide_out_top);
    builder.setExitAnimations(context, R.anim.slide_in_top, R.anim.slide_out_bottom);
}

现在链接在 Chrome 自定义选项卡中打开,但所有自定义选项都不起作用。 ToolbarColor 没有改变,动画不起作用。 此外,网站标题在 Chrome 自定义选项卡上不可见,只有基本 URL 可见。 请帮我解决这个问题。

【问题讨论】:

    标签: android chrome-custom-tabs


    【解决方案1】:

    在启动 url 之前添加构建器设置 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-01
      • 2017-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多