私のアプリでは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));
私にとっては正しいです。だから問題は何ですか。