在我的应用程序中,我有LinearLayout
一个FrameLayout
内部。两者都设置为fill_parent
。我正在以全屏模式运行我的应用程序。但即使使用这些参数,布局也不会膨胀。屏幕中央及其周围的LinearLayout
残骸被黑色填充。我现在在这里放一些代码:
super.onCreate(savedInstanceState);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if(getWindowManager().getDefaultDisplay().getOrientation() == 0) {
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
setContentView(R.layout.main);
handler = new Handler();
pictureTime = 0L;
isRunning = false;
_camView = new CameraPreview(this);
((FrameLayout)findViewById(R.id.cameraFrame)).addView(_camView, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
inflater = LayoutInflater.from(this);
View overlayView = inflater.inflate(R.layout.cameraoverlay, null);
this.addContentView(overlayView,
new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
对我来说是正确的。所以有什么问题。