into the map Alarm app, the layer relationship is like this: Subwayview on the lines on the first line of the elements: lines, site name-label, site location (circled)-view.shapelayer Uibezierpath way to draw; Subwaview Add on the ScrollView, and then realize the zoom out operation, found that the upper and lower left and right mobile time is not very smooth feeling, analysis should be Subwayview subview number (more than 200) has an impact.
Think of the method Subwayview after drawing all the Subview, convert it to image, then remove all the Subview, then Nest ImageView on Subwayview, then scale is equivalent to scaling one iamge.
The test was smooth enough. The problem depends on the solution. But found that the text of the label is very vague, especially after zooming in, so it is necessary to improve the conversion of the image pixels, using the following methods:
-(UIImage *) Convertviewtoimage: (uiview*) v{ // Set high resolution to prevent text blur false, [[ UIScreen Mainscreen] scale]*2); [V.layer Renderincontext:uigraphicsgetcurrentcontext ()]; UIImage*image = uigraphicsgetimagefromcurrentimagecontext (); Uigraphicsendimagecontext (); return image; }
Uiscrollview Performance Optimization-View to Image