2017-11-25 159 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

相關問題