开发者

Why is my camera preview not respecting the layout?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜