I want to create this interface of action bar and status bar in my application in android studio
Asked
Active
Viewed 1,544 times
2 Answers
0
There are multiple methods to do that
- Create custom theme. You can do that by going to Tools->Android->Theme Editor and create your custom theme as per your requirement.
- You change the
colorPrimary
andcolorPrimaryDark
to@android:color/transparent
in res->values->colors.xml. - Create a custom tool bar and set its background like this
android:setBackground="@android:color/transparent"
and change thecolorPrimarDark
to@android:color/transparent
in colors.xml. But for this method you have to select anoActionBar
theme like -android:theme="@style/Theme.AppCompat.Light.NoActionBar
.

Ashutosh Sagar
- 981
- 8
- 20
-
I have already tried this. But I am using an activity with drawer layout which is the mai problem i guess. – Aashish Jul 19 '17 at 04:24
-
Even with drawer layout, you can use a custom toolbar and for that 3rd method will do the work – Ashutosh Sagar Jul 19 '17 at 04:40
-
-
Well it worked for me but now I am using a full screen background for my activity and it automatically hides my status bar, but I want the status bar to be shown always on the top. – Aashish Jul 19 '17 at 05:04
-
-
-
Change it with the theme I've given above. That will remove your toolbar but your upper header will remain intact. – Ashutosh Sagar Jul 19 '17 at 11:54
-
0
Set Theme to Your Activity as below. style.xml
<style name="my_style" parent="Theme.AppCompat.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowTranslucentStatus">true</item>
</style>

Sanjiv Patel
- 11
- 2