Saturday 22 December 2012

View the full size Android [Android Tutorial] ^^


Today I will call it a trick rather than a tutorial as it will be very short. It was a few days I did wave research to hide the title bar but above the status bar to display my application Android in full screen.
This is Sebastian gave me the trick so thank you to him. There are two ways to do so, either by the Java code or via the file AndroidManifest.xml . We will see both ways.

JAVA

Just add a line to hide the title bar and a line to hide the status bar in the method OnCreate your Activity .
@ Override
 public  void onCreate ( Bundle savedInstanceState )  { 
     super . onCreate ( savedInstanceState ) ; 
     / / To hide the title bar 
     requestWindowFeature ( Window . FEATURE_NO_TITLE ) ;
  
     setContentView ( R. layout . tabs1 ) ; 
     / / To hide the status bar and So put your application in full
 

Via AndroidManifest.xml

To hide only the title bar to add in your statement this Activity:
  android: name = ". LeNomDeVotreClasse"  
           android: theme = "@ android: style / Theme.NoTitleBar" />
To hide the title bar and status bar add in your statement this Activity:
  android:name=".LeNomDeVotreClasse"
           android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
Now you know now view your Android application in full screen. This is primarily useful when developing games, we're not there yet but it will come sooner than you think! As usual, if you made ​​this tutorial service, do not hesitate to click the little "+" on the top right of the tutorial and share it on Twitter andFaceBook . Thank you for helping Mobile Tutorial !;)

No comments:

Post a Comment

Free Automatic Backlink