¿Cómo crear un fragmento sin barra de acción en Android?
Frecuentes
Visto 1,331 veces
0
Hi all I have to create fragment with out action bar. Like this
In this picture I created Lienarlayout and placed that image in center. Below of that I want to create 4 fragments like projects,calender,filter and search. I searched a lot and tried by many codes but all the fragments has created with action bar. But i need to create fragments without action bar. How can I create that? Can anybody tell me? Thanks in advance.
1 Respuestas
0
ActionBars are actually components of your Activity objects and not your Fragments. (Take a look at the ActionBar documentation here). If your app is API level >= 11, your Activity objects will have ActionBars by default. These are set by the SDK-provided Holo theme. You can remove the ActionBar from the Activity to which your fragments are attached.
In order to do so, modify the Holo theme. Create a styles resource like so:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="NoActionBar" parent="">
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>
Then in your manifest you should associate the modified theme with the Activity that you want to be ActionBar-less:
<activity
android:name="com.yourproject.activity.NoActionBarActivity"
android:theme="@style/NoActionBar" >
</activity>
respondido 27 nov., 13:09
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas android android-fragments android-actionbar android-tabhost or haz tu propia pregunta.