zoukankan      html  css  js  c++  java
  • android实现屏幕全屏

      去掉标题栏:

    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.

      用法:

    1 @Override
    2 protected void onCreate(Bundle savedInstanceState) {
    3 // TODO Auto-generated method stub
    4   super.onCreate(savedInstanceState);
    5 requestWindowFeature(Window.FEATURE_NO_TITLE);
    6 getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    7 getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
    8 setContentView(R.layout.newslists);
    9 newsListLayout = findViewById(R.id.newslistlayout);
    10 newsListLayout.setBackgroundColor(Color.MAGENTA);
    11
    12 newsNameList = (ListView) findViewById(R.id.newsnamelist);
    13 model = new Model(0, 6);
    14 nameListAdapter = new NewsNameListAdapter(this, model);
    15 newsNameList.setAdapter(nameListAdapter);
    16
    17 showPage = (TextView) findViewById(R.id.newslistshowpage);
    18 updatePage(model.getIndex());
    19 }

      效果图:

      

  • 相关阅读:
    [极客大挑战 2019]EasySQL CTF复现
    [极客大挑战 2019]Havefun (一起来撸猫) CTF复现
    一个简单漂亮的登录页面(前端)
    Python XPath的使用
    Python Requests的基本用法
    Linux配置jdk环境变量
    高性能 Java RPC 框架 Dubbo
    Zookeeper的配置文件及命令
    zookeeper怎么实现分布式锁
    Zookeeper-集群崩溃恢复
  • 原文地址:https://www.cnblogs.com/shang53880/p/1955968.html
Copyright © 2011-2022 走看看