2017-11-25 160 views
0

WebView with Title and Url and action menu that opens the page into Chrome应该使用什么样的视图来获取WebView的标题和Url,如下图所示?

所以你可以看到有一个标题“Casi di femminicidio ...”和一个Url正下方。在右边有一个菜单,其中包含一个按钮,可直接将URL打开到Chrome选项卡中。我认为向用户展示实际的url和协议是很好的。它是一个默认的视图类型?

+0

这是一款经典的工具栏,请查看https://developer.android.com/reference/android/support/v7/widget/Toolbar.html –

回答

0

此行添加到您的依赖关系:

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

祝你好运!

+0

非常感谢! – Nullo

相关问题