setCloseButtonIcon() method doesn't change default Close button

余生长醉 提交于 2019-12-18 14:58:10

问题


I try to change default icon for Close Button in Chrome custom tabs (CustomTabsIntent.Builder)

Simple code for testing:

Bitmap closeIcon = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);
intentBuilder.setCloseButtonIcon(closeIcon);

But nothing happens. Why? (Nexus 7, Marshmallow)


回答1:


Typically this is caused by using a bitmap that has the 'wrong' dimensions. The correct dimensions are documented here: https://developer.android.com/reference/android/support/customtabs/CustomTabsIntent.html#KEY_ICON



来源:https://stackoverflow.com/questions/34614584/setclosebuttonicon-method-doesnt-change-default-close-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!