简体   繁体   English

Chrome自定义标签中的关闭按钮样式

[英]Close button style in Chrome custom tabs

I'm trying to change the back button icon in chrome custom tabs from the standard ' x ' to a back arrow, ' < '. 我正在尝试将chrome自定义标签中的后退按钮图标从标准的' x '更改为后退箭头' < '。

I know I can use the setCloseButtonIcon(Bitmap icon) method while I'm building the intent to set a custom bitmap for the button. 我知道在构建旨在为按钮设置自定义位图的意图时,可以使用setCloseButtonIcon(Bitmap icon)方法。

But checking this issue: Close button should be shown instead of a back button on the toolbar of chrome custom tab , from the Chromium bug tracker I saw that it was fixed with this resolution: 但是检查了这个问题:在Chromium Bug跟踪器中,应该在chrome自定义选项卡的工具栏上显示“关闭”按钮,而不是后退按钮

The flag "android.support.CUSTOM_TABS:close_button_style" was added for the developers to customize the style of close button. 添加了标记“ android.support.CUSTOM_TABS:close_button_style”,供开发人员自定义关闭按钮的样式。 The default setting is "X", and developers are granted with an option of "<". 默认设置为“ X”,开发人员可以选择“ <”。

The problem is that I can't find a way to use it while I'm building the custom tab. 问题是,在构建自定义标签时,我找不到使用它的方法。 Does anyone know how I can change the style using this approach? 有谁知道我可以使用这种方法更改样式?

The CLOSE_BUTTON_STYLE was an old parameter and it was removed in this commit : CLOSE_BUTTON_STYLE是一个旧参数,在此提交中已将其删除:

Let client app customize close button 让客户端应用自定义关闭按钮

There has been strong feedback requesting customizeable close button. 强烈要求提供可定制的关闭按钮的反馈。 This CL implements it by getting a bitmap from the passed intent. 此CL通过从传递的意图中获取位图来实现它。

BUG=513512 错误= 513512

Review URL: https://codereview.chromium.org/1263583003 审核网址: https//codereview.chromium.org/1263583003

Cr-Commit-Position: refs/heads/master@{#340941} Cr提交位置:refs / heads / master @ {#340941}

As you can see it was removed from CustomTabIntentDataProvider.java . 如您所见,它已从 CustomTabIntentDataProvider.java删除

Now the only available option is to use the method setCloseButtonIcon(Bitmap icon) that you already know. 现在唯一可用的选项是使用您已经知道的方法setCloseButtonIcon(Bitmap icon)

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

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