zoukankan      html  css  js  c++  java
  • Android中两种设置全屏的方法

    设置全屏的两种方法:

    第一种:在配置文件里面配置:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.lp.ecjtu"
        android:versionCode="1"
        android:versionName="1.0" >

        <uses-sdk android:minSdkVersion="10" />

        <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
            <activity
                android:name=".FullScreenActivity"
                android:label="@string/app_name"
                android:theme="@android:style/Theme.NoTitleBar" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>

    </manifest>

    第二种:在java代码里面写:

    package com.lp.ecjtu;

    import android.app.Activity;
    import android.app.DownloadManager.Request;
    import android.os.Bundle;
    import android.view.Window;
    import android.view.WindowManager;

    public class FullScreenActivity extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            //无标题
            requestWindowFeature(Window.FEATURE_NO_TITLE);
            //全屏
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
            setContentView(R.layout.main);
        }
    }

  • 相关阅读:
    Java运行时数据区域
    线程的实现原理
    redis分布式锁的实现
    Incorrect string value: 'xF0x9Fx92x8BTi...'错误
    linux命令之less命令
    Hive数据类型和DDL操作
    Hive安装、配置和使用
    CentOS 7安装配置MySQL 5.7
    Spring+SpringMVC+MyBatis整合
    MyBatis的事物管理和缓存
  • 原文地址:https://www.cnblogs.com/200911/p/3338099.html
Copyright © 2011-2022 走看看