android 去掉actionbar 隐藏标题栏 全屏


 

去掉actionbar :getActionBar().hide();

 

 全屏方法一:

<activity
            android:name="com.imax.weather.MainActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"  >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

 

 

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);

    }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM