效果:
在Activity的OnCreate()方法中,setContentView()之前添加代码:
if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.KITKAT) {
Window w = getWindow();// in Activity's onCreate() for instance
w.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}