只要Activity为全屏,让自定义的view的长宽是当前分辩率就好了,

解决方案 »

  1.   

    在onCreate里面调用下面这两个函数:
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);然后把ListView的width、height设置为fill_parent
      

  2.   

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏标题栏
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN);//隐藏状态栏
    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);
    screenWidth = metrics.widthPixels;//获取屏幕宽高
    screenHeight = metrics.heightPixels;
    setContentView(R.layout.main);
    }
    这样就全屏了