【发布时间】: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