I Have set an image in my ActivityMain.xml, and there is no action bar theme is used. I want
The photo that I set in the background this image will show the background of the status bar.
What I assume from your question is that you want to achieve a Full Screen Activity with your blue color as background of status bar for that you can set your status bar to transparent and your screen to stretch out to full screen
window?.decorView?.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
window.statusBarColor = Color.TRANSPARENT
2
Answers
What I assume from your question is that you want to achieve a Full Screen Activity with your blue color as background of status bar for that you can set your status bar to transparent and your screen to stretch out to full screen
You need can achieve that by following steps:
styles.xml
Note:
android:windowTranslucentNavigation
is important attribute here.Now in your activity xml’s parent layout, add
android:fitsSystemWindows="true"
to fill your UI in full screen.in your Activity class, inside
onCreate
Method, need to setNO_LIMIT
flag like this;Hope, this will helps you.