天天看点

全屏

方法一:配置文件  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

详情:

 <activity android:name=".GameActivity"

                  android:label="@string/app_name"

                  android:configChanges="keyboardHidden|orientation" 

                  android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

                  android:screenOrientation="landscape"

                 >

     </activity>

方法二:代码

public class test extneds Activity{

  pubilc void onCreate(Bundle savedInstanceState){

    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);//无title

    getWindow().setFlags(WindowManager.LayoutParams,FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

    setContentView(R.layout.main);

  }

}

继续阅读