Chrome 自定义选项卡自定义设置,如 setToolbarColor、开始和退出动画不起作用
Chrome Custom Tabs customisations like setToolbarColor, start and exit animations are not working
我是 Android 的新手,正在尝试在 Chrome 自定义选项卡中打开 link。我创建了一个功能,可以在 Chrome 自定义选项卡中打开应用程序上的任何 link:
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);
}
现在 link 正在 Chrome 自定义选项卡中打开,但 none 的协整化正在运行。 ToolbarColor 没有改变,动画不工作。
此外,站点标题在 Chrome 客户选项卡上不可见,只有基础 url 可见。
请帮助我解决这个问题。
在启动 url 之前添加构建器设置 :)
我是 Android 的新手,正在尝试在 Chrome 自定义选项卡中打开 link。我创建了一个功能,可以在 Chrome 自定义选项卡中打开应用程序上的任何 link:
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);
}
现在 link 正在 Chrome 自定义选项卡中打开,但 none 的协整化正在运行。 ToolbarColor 没有改变,动画不工作。 此外,站点标题在 Chrome 客户选项卡上不可见,只有基础 url 可见。 请帮助我解决这个问题。
在启动 url 之前添加构建器设置 :)