I want to create this interface of action bar and status bar in my application in android studio
Asked
Active
Viewed 1,487 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
colorPrimaryandcolorPrimaryDarkto@android:color/transparentin res->values->colors.xml. - Create a custom tool bar and set its background like this
android:setBackground="@android:color/transparent"and change thecolorPrimarDarkto@android:color/transparentin colors.xml. But for this method you have to select anoActionBartheme like -android:theme="@style/Theme.AppCompat.Light.NoActionBar.
Ashutosh Sagar
- 961
- 7
- 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