2
I intend to create a web app with a WebView
. How can I create an application without a title bar that isn’t fullscreen?
2
I intend to create a web app with a WebView
. How can I create an application without a title bar that isn’t fullscreen?
3
There are several ways, one of them is to define using the Window.FEATURE_ACTION_BAR
passing by getActionBar().hide()
in his Activity
:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getActionBar().hide();
In the res/styles.xml
you can do it this way:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
But it can also be done this way 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) inside the file res/styles.xml
:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>
</resources>
1
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">
When I build the app to work
That’s not why. Check the Android Studio log.
Browser other questions tagged java android android-layout webview
You are not signed in. Login or sign up in order to post.
Sem Action Bar?
– Reginaldo Rigo
do not know the right name, without the bar where display the title of the application and where you can have the icon to open the menu etc
– Jefferson Mello Olynyki
In which android version?
– Thiago Luiz Domacoski