开发者

Why is my camera preview not respecting the layout?

开发者 https://www.devze.com 2023-03-07 18:55 出处:网络
I\'m creating a开发者_如何转开发 SurfaceView for my camera preview and attempting to have it occupy a rectangle that\'s smaller than the entire screen, but it\'s ignoring my layout command.

I'm creating a开发者_如何转开发 SurfaceView for my camera preview and attempting to have it occupy a rectangle that's smaller than the entire screen, but it's ignoring my layout command.

I assume I'm doing something wrong, but can't find an example of someone setting the preview into a smaller container.

All advice (or pointers to examples) appreciated.


That's how it's done in the default Camera application: layout file and source code.

There's a container that performs a special layout procedure depending on a given aspect ratio. I think you can adapt this solution to your needs.

0

精彩评论

暂无评论...
验证码 换一张
取 消