F
F
Fotonick2016-10-24 21:40:31
Android
Fotonick, 2016-10-24 21:40:31

How to make actionbar transparent?

In my application, there is a main activity in which fragments change when you click on the bottom panel with icons (like on Instagram). By design, I need that when one of the ActionBar fragments is turned on, it becomes transparent (and at the same time the title and logo disappear) and only the context menu button remains. I tried everything I could find on stackoverflow, but I couldn't make the actionbar transparent. No amount of setting transparency or importing an alternate view for the actionbar does the job. Only getactionbar().hide fires. but this method hides the actionbar along with the menu button, which is what I need. Someone share an adequate working code for setting transparency while maintaining the menu button (three dots which).

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Grichenko, 2016-10-24
@Kalobok

I figured it out somehow, but I don't remember the details. It seems that there it was necessary to twist not only the ActionBar, but also the Toolbar that it has inside. And there were some other tricks about the fact that some properties could only be set through ThemeOverlay.

D
davidnum95, 2016-10-25
@davidnum95

You can put the ActionBar in CollapsingToolbarLayout and do collapsingToolbar.setContentScrimColor(Color.TRANSPARENT)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question