繁体   English   中英

我应该使用哪种视图来获得WebView的标题和网址,如下图所示?

[英]What kind of View should I use so to get the Title and the Url of a WebView like in the image below?

带有标题和网址的WebView以及可将页面打开到Chrome中的操作菜单

因此,您可以看到标题“ Casi di femminicidio ...”和位于其下方的一个网址。 右侧有一个菜单,其中包含一个按钮,可直接将网址打开到chrome标签中。 我认为最好向用户显示实际的URL和协议。 它是默认视图类型吗?

将此行添加到您的依赖项:

implementation 'com.android.support:customtabs:26.1.0'

然后使用:

new CustomTabsIntent
            .Builder()
            .build()
            .launchUrl(this, Uri.parse("http://google.com"));

如果您想更改条形的颜色,请使用:

            .setToolbarColor()

此处更多内容: https//developer.chrome.com/multidevice/android/customtabs

祝好运!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM