效果:
在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);
}