/** Set the Scanning direction based on the screen direction * @ author maguang * @ Param parameter * @ return result */-(void) showacapture {cgaffinetransform transform; If (self. interfaceorientation = uiinterfaceorientationlandscapeleft) {self. capture. rotation = 180.0f; transform = cgaffinetransformmakerotation (m_pi/2);} else if (self. interfaceorientation = uiinterfaceorientationlandscaperight) {self. capture. rotation = 0.0f; transform = cgaffinetransformmakerotation (-m_pi/2);} else if (self. interfaceorientation = uiinterfaceorientationportrait) {self. capture. rotation = 90.0f; transform = cgaffinetransformmakerotation (0);} else if (self. interfaceorientation = uiinterfaceorientationportraitupsidedown) {self. capture. rotation = 270.0f; transform = cgaffinetransformmakerotation (m_pi);} [self. capture settransform: Transform]; cgrect F = cgrectmake (0, 0, self. view. bounds. size. width, self. view. bounds. size. height); self. view. layer. frame = f; self. capture. layer. frame = f ;}
1. In-(void) viewwillappear :( bool) animated
Method.
2. Call this method in the response screen rotation method at the same time.
Use zxingobjc to scan the horizontal and vertical screen of the QR code