当前位置: 移动技术网 > IT编程>移动开发>Android > android屏幕全屏的实现代码

android屏幕全屏的实现代码

2019年07月24日  | 移动技术网IT编程  | 我要评论

职位说明书模板,蜡像馆丧尸,矿山机械设备

去掉标题栏:
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());
     }

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网