Vollbild in XML angeben

G

germanytwo

Erfahrenes Mitglied
9
Hi Leute,
ich beschäftige mich seit neustem mit java/android/opengl.
Nun, wenn ich in der app die NotificationBar und den Title weghaben will muss ich doch eigentlich nur ein paar zeilen in der activity_main.xml ändern
nähmlich von

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />

</RelativeLayout>


zu

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />

</RelativeLayout>



Doch es verändert sich im Layout rein gar nichts, hab ich noch was vergessen? :blink:

Danke im voraus.
LG :laugh:
 
Du musst in der AndroidManifest.xml bei der jeweiligen Activity Theme.NoTitlebar.Fullscreen angeben

Gesendet von meinem GT-I9100 mit der Android-Hilfe.de App
 
Vielen dank, werd ich gleich mal probieren.

LG
 
germanytwo schrieb:
Vielen dank, werd ich gleich mal probieren.

LG

Brauchst du ein code schnipsel oder schaffst dus so?

Gesendet von meinem GT-I9100 mit der Android-Hilfe.de App
 
ein codeschnipsel wäre recht hilfreich, wenn du einen hättest.

LG
 
Hi, im Ordner Values -> styles.xml

Code:
<resources>

    <style name="AppTheme" parent="android:Theme.Black.NoTitleBar.Fullscreen" />

</resources>
und im Manifest

Code:
<application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

...

</application>
Das ist dann der Schwarze Hintergrund >>Black<<. Du kannst natürlich auch eigene Styles erstellen dafür musst du dann im Google tutorials suchen und/oder hier wieder Fragen stellen^^.

mfg
 

Ähnliche Themen

D
Antworten
23
Aufrufe
2.383
Data2006
D
OnkelLon
Antworten
13
Aufrufe
1.923
OnkelLon
OnkelLon
M
Antworten
0
Aufrufe
1.124
mglinka99
M
Zurück
Oben Unten