protected override void OnLayout(bool changed, int l, int t, int r, int b) { var msw = MeasureSpec.MakeMeasureSpec(r - l, MeasureSpecMode.Exactly); var msh = MeasureSpec.MakeMeasureSpec(b - t, MeasureSpecMode.Exactly); surfaceView.Measure(msw, msh); surfaceView.Layout(0, 0, r - l, b - t); }
protected override void OnLayout(bool changed, int l, int t, int r, int b) { if (surfaceView != null) { System.Diagnostics.Debug.WriteLine("OnLayout"); var msw = MeasureSpec.MakeMeasureSpec(r - l, MeasureSpecMode.Exactly); var msh = MeasureSpec.MakeMeasureSpec(b - t, MeasureSpecMode.Exactly); surfaceView.Measure(msw, msh); surfaceView.Layout(0, 0, r - l, b - t); } }
protected override void OnLayout(bool changed, int l, int t, int r, int b) { base.OnLayout(changed, l, t, r, b); var msw = MeasureSpec.MakeMeasureSpec(r - l, MeasureSpecMode.Exactly); var msh = MeasureSpec.MakeMeasureSpec(b - t, MeasureSpecMode.Exactly); view.Measure(msw, msh); view.Layout(0, 0, r - l, b - t); transparentView.Measure(msw, msh); transparentView.Layout(0, 0, r - l, b - t); textureView.Measure(msw, msh); textureView.Layout(0, 0, r - l, b - t); }
protected override void OnLayout(bool changed, int l, int t, int r, int b) { try { surfaceView.Measure(MeasureSpec.MakeMeasureSpec(r - l, MeasureSpecMode.Exactly) , MeasureSpec.MakeMeasureSpec(b - t, MeasureSpecMode.Exactly)); surfaceView.Layout(0, 0, r - l, r - l); var childWidth = r - l; var childHeight = b - t; for (int i = 0; i < ChildCount; ++i) { GetChildAt(i).Layout(0, 0, childWidth, childHeight); } SetOrientation(); } catch (Exception ex) { Console.WriteLine("BarCodeCameraPreview Exception : {0}", ex.ToString()); } }