问题
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