Custom Translucent Android ActionBar

前端 未结 7 1019
梦如初夏
梦如初夏 2020-11-29 16:19

I\'ve been scouring the interwebs (e.g. Android documentation, answers here, etc.) for the answer to what I thought would be a fairly trivial question. How do you achieve a

7条回答
  •  南笙
    南笙 (楼主)
    2020-11-29 16:26

    The above code is absolutely correct for making an action bar.

    Instead of

    getActionBar().setBackgroundDrawable(new ColorDrawable(Color.argb(128, 0, 0, 0)))
    

    use

    getActionBar().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    

    In this way, you will able to see the action bar fully transparent.

提交回复
热议问题