How to change a title color in Chrome Custom Tabs

前端 未结 4 1004
自闭症患者
自闭症患者 2021-02-05 10:14

Is there any way to change a title color in Chrome Custom Tabs?

I applied Chrome custom tabs to show a web page. To do, I utilized CustomTabsIntent.Builder class. Howev

相关标签:
4条回答
  • 2021-02-05 10:47

    Set the toolbar color.

    intentBuilder.setToolbarColor(ContextCompat.getColor(this, R.color.colorPrimary));
    
    0 讨论(0)
  • 2021-02-05 10:50

    You can't change color of tittle programmatically in Chrome Custom Tab. The only way you can follow is Material Design Specifications.

    If you have primary and primaryDark color of your app with dark shade, than Custom Tabs will use dark tittle, dark close button and dark overflow menu button.

    If you have primary and primaryDark color with light shade, than Chrome Custom Tabs will use light tittle etc.

    So, you must pay attention on number of you primary and primaryDark color.

    0 讨论(0)
  • 2021-02-05 10:50

    It would be nice if there was a possibility to change the color of the text and statusbar. For example our app has different color settings so now there's no coherence between the app and Chrome Custom Tabs. That looks kinda bad.

    Maybe there's a chance to get Chrome Custom Tabs colors for text and statusbar so that we could adjust it to our app (we have templates that user can choose).

    0 讨论(0)
  • 2021-02-05 10:55

    As mentioned in one of the responses, the title text color is chosen automatically for the best contrast with the title color, there is no other way to set it.

    0 讨论(0)
提交回复
热议问题