手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >android屏幕全屏的实现代码
android屏幕全屏的实现代码
摘要:去掉标题栏:requestWindowFeature(Window.FEATURE_NO_TITLE);API上是这么说的:intFEATU...

去掉标题栏:

requestWindowFeature(Window.FEATURE_NO_TITLE);

API上是这么说的:

int FEATURE_NO_TITLE Flag for the "no title" feature, turning off the title at the top of the screen.

屏幕全屏:

getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

API上是这么说的:

int FLAG_FULLSCREEN Window flag: Hide all screen decorations (e.g.

屏幕没有边界限制(允许窗口扩展到屏幕外):

getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

API上是这么说的:

int FLAG_LAYOUT_NO_LIMITS Window flag: allow window to extend outside of the screen.

用法:

复制代码 代码如下:

@Override

protected void onCreate(Bundle savedInstanceState) {

// TODO Auto-generated method stub

super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_NO_TITLE);

getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);

getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);

setContentView(R.layout.newslists);

newsListLayout = findViewById(R.id.newslistlayout);

newsListLayout.setBackgroundColor(Color.MAGENTA);

newsNameList = (ListView) findViewById(R.id.newsnamelist);

model = new Model(0, 6);

nameListAdapter = new NewsNameListAdapter(this, model);

newsNameList.setAdapter(nameListAdapter);

showPage = (TextView) findViewById(R.id.newslistshowpage);

updatePage(model.getIndex());

}

【android屏幕全屏的实现代码】相关文章:

android md5加密与rsa加解密实现代码

Android ellipsize的小问题介绍

android二级listview列表实现代码

android 类似微信的摇一摇功能实现思路及代码

android实现上下滚动的TextView

Android 图片特效处理的方法实例

Android ViewPager相册横向移动的实现方法

android实现字体闪烁动画的方法

Android对字符串的处理

Android通话记录备份实现代码

精品推荐
分类导航