Background Ripple Effect on StandAlone Toolbar items is gone

前端 未结 6 531
遥遥无期
遥遥无期 2020-12-10 01:46

Using the Standalone toolbar has an issue with the select able background of the items, following this article didn\'t work also:

http://blog.mohitkanwal.com/blog/20

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 02:04

    This was done using android 5.1 genymotion emulator

    I didn't figure out your problem, but I just tried to create a toolbar the same as yours, but with removing some style that I don't have

    here is my style

      
    

    My Toolbar layout

     
    

    My Menu

    
    

    The activity code

       Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
       toolbar.inflateMenu(R.menu.menu_home);
    

    Screenshot of the result

    Screenshot of working toolbar


    Edit

    after downloading the sample you provided in the question, the problem has nothing to do with standalone toolbar or actionbar (both have the same problem) when using AppBarLayout, the problem seems that the Ripple effect will be drawn on AppBarLayout instead of the View of the selected menu item, I'll record a video explaining it.

    the video: AppBarLayout with Toolbar Video

    I'll try to find a solution for this.

提交回复
热议问题