问题
i would like to get rid of the defualt grey bar which apears at the top of my application. I just can't seem to find the attribute or setting to do so. how can this be achived? thanks
回答1:
Use android:theme="@android:style/Theme.NoTitleBar", either for this specific <activity> element in your manifest, or for the whole <application> element if you want it gone for all of them. Here's a FAQ entry about it.
回答2:
I tried the manifest method but for some reason it wasn't working. However using the .java method as described here worked.
requestWindowFeature(Window.FEATURE_NO_TITLE);
回答3:
Open app/src/main/res/values/styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
</style>
</resources>
回答4:
A good article why you should avoid removing the title bar from an app by Googler Reto Meier: http://blog.radioactiveyak.com/2010/07/how-to-display-android-status-bar-in.html
Read and rethink if you really need to remove the title bar from your app.
来源:https://stackoverflow.com/questions/3526848/how-to-get-rid-of-the-program-name-bar-at-the-top-of-the-application