As far as I know there are only 2 scale types that can be configured in previewScaleType(), known as ScaleType.CenterCrop and ScaleType.CenterInside.
Now suppose I don't want my preview to be cropped (because I need to overlay something on it on a exact position). So I must use CenterInside.
The problem is, no matter I set match_parent or wrap_content to CameraView's xml, it always fill the screen, and the preview is centered in the screen. And that leaves blank area in both top and bottom space; but I need my preview to be pinned at the top.
As far as I know there are only 2 scale types that can be configured in
previewScaleType()
, known asScaleType.CenterCrop
andScaleType.CenterInside
.Now suppose I don't want my preview to be cropped (because I need to overlay something on it on a exact position). So I must use
CenterInside
.The problem is, no matter I set
match_parent
orwrap_content
toCameraView
's xml, it always fill the screen, and the preview is centered in the screen. And that leaves blank area in both top and bottom space; but I need my preview to be pinned at the top.Is this possible?