I want to create a app web with a WebView
. How can I create an application without the title bar other than fullscreen ?
I want to create a app web with a WebView
. How can I create an application without the title bar other than fullscreen ?
There are several ways, one of which is to set Window.FEATURE_ACTION_BAR
passing getActionBar().hide()
to its Activity
:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getActionBar().hide();
No res/styles.xml
you can do this:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
However, this can also be done by disabling the ActionBar
provided by the theme. The easiest way is to have your theme extend from Theme.AppCompat.NoActionBar (or the light variant) within the file res/styles.xml
:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>
</resources>
Change this part of your AndroidManifest
...
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
android:screenOrientation="portrait"
android:name=".Principal"
android:theme="@android:style/Theme.Holo.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
The important thing is this line:
android:theme="@android:style/Theme.Holo.Light.NoActionBar">