In my application, I would like to save the status bar, but make its background will be the same as on the main screen.
So, I created a special theme for setting the background of the application:
<resources> <style name="Theme.Shelves" parent="android:Theme"> <item name="android:windowBackground">@drawable/background_shelf</item> <item name="android:windowNoTitle">true</item> </style> </resources>
Then put this in the manifest:
<application android:icon="@drawable/icon" android:theme="@style/Theme.Shelves" android:label="@string/app_name"> <activity android:name=".HelloWorld" android:label="@string/app_name">
And get the following:
Screenshot 2
Everything is fine, except for the separator line between the status line and the main screen. I thought this was due to the addition of text, so I set it to zero, but nothing has changed.
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); tv.setText("Hello World"); setContentView(tv); tv.setPadding(0,0,0,0); }
Please let me know if you have any idea about this. Thanks.
source share