Chrome Custom Tabs change the default close button not working

前端 未结 7 582
清歌不尽
清歌不尽 2021-01-17 11:30

I am trying to change the default close button on the actionbar of the custom chrome tabs. I have tried to set using setCloseButtonIcon() However, the default c

7条回答
  •  天涯浪人
    2021-01-17 12:05

    I have an observation. Last month, when searching through SO for various chrome custom tab issues, I found this answer suggesting to use 24dp size icon and also found this question saying that it is working fine with PNG.

    I have checked your code with using back arrow icon from here.

    When I used "ic_arrow_back_black_48dp", it didn't change the default close button to an arrow (see left image).

    final Bitmap backButton = BitmapFactory.decodeResource(getResources(), R.drawable.ic_arrow_back_black_48dp);
    

    But when I used "ic_arrow_back_black_24dp", it perfectly changed the default close button to an arrow (see right image).

    final Bitmap backButton = BitmapFactory.decodeResource(getResources(), R.drawable.ic_arrow_back_black_24dp);
    

    As it has worked perfectly for me, you should also try with "24dp" size back arrow icon from here instead of "48dp" size back arrow icon.

    Screenshot : [ Device: ASUS_Z00UD; OS: 6.0.1 ]

提交回复
热议问题