一、在代码中设置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 package com.hhh.changeimage; import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; public class ChangeImage extends Activity { public void onCreate(Bundle savedInstanceState) { super .onCreate(savedInstanceState); //无title requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams. FLAG_FULLSCREEN); setContentView(R.layout.main); }
无title和全屏段代码必须在setContentView(R.layout.main) 之前,不然会报错。 二、在配置文件里修改(android:theme=”@android:style/Theme.NoTitleBar.Fullscreen”)
1 2 3 4 5 6 7 8 < activity android:name = ".ChangeImage" android:theme = "@android:style/Theme.NoTitleBar.Fullscreen" android:label = "@string/app_name" > < intent-filter > < action android:name = "android.intent.action.MAIN" /> < category android:name = "android.intent.category.LAUNCHER" /> </ intent-filter > </ activity >
用一的情况在应用运行后,会看到短暂的状态栏,然后才全屏,而第二种方法是不会有这种情况的。

更多相关文章

  1. Android(安卓)关于显示键盘,布局错乱网上顶的问题
  2. Android(安卓)代码片段---从相册或相机获取图片保存并处理
  3. Eclipse 开发 Android, Hello FormStuff(学习9)
  4. Android(安卓)监听WiFi的开关状态实现代码
  5. [Android]android.util.AndroidRuntimeException: requestFeatur
  6. Android(安卓)TTS的简单应用
  7. Android(安卓)ANR 分析
  8. android如何用代码实现界面ui
  9. android 如何获取当前运行的activity

随机推荐

  1. Android为什么引入HAL
  2. Android 进阶 教你打造 Android 中的 IOC
  3. 老项目在Android Studio 3.6.1不能运行解
  4. Android深入浅出之Zygote[1]
  5. android 基于百度地图api开发定位以及获
  6. Android(安卓)订餐APP(Sqlite数据库,完整的
  7. 如果没有 Android 世界会是什么样子?
  8. Android Scroller及下拉刷新组件原理解析
  9. android 自定义spinner
  10. Android入门(1) 不一样的HelloWorld