search

Home  >  Q&A  >  body text

ios - 在向UIImagePickerController中添加自定义视图时,如何定位视图的位置?

Rt

想要在拍照时让取景器中心出现一个十字,在通过UIImagePickerControllercameraOverlayView属性添加十字的视图时,如何定位才能放到取景器的中心呢?很明显取景器视图中心位置和屏幕的中心位置并没有重合。而且UIImagePickerController的视图结构是私有的,没办法得到任何关于取景器视图范围的信息。

thx

怪我咯怪我咯2812 days ago635

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 15:18:59

    Statement

    I don’t have any specific practice myself, sorry. What the questioner means is that the center point cannot be obtained?

    Quote

    Since I didn’t write it myself, I tried to quote the article, hoping it can help the questioner.

    The following article introduces: 这个代码就可以实现拍照功能了,如果把注释掉的代码加上就可以添加overlayview,比如十字准星,条形码扫描框之类的

    Reference: Implementation of UIImagePickerController obtaining photos and adding overlay method

    reply
    0
  • Cancelreply