1. uiscrollview setting background image
//Setup the scroll ViewUiscrollview * tempscrollview = (uiscrollview *) Self. view; tempscrollview. contentsize= Cgsizemake (320,720);//Set stationary background, so that while the user scroll the background is//Fixed.Uiimage * IMG = [uiimage imagenamed:@"Bg-body.jpg"]; [Tempscrollview setbackgroundcolor: [uicolor colorwithpatternimage: img];
2. Set the background image in uiview
Self. View. backgroundcolor = [uicolor colorwithpatternimage: [uiimage imagenamed:@"1. jpg"];
3. Comparison of the following types of recommendations
Set background image in uiview
Uiimageview * bgview = [[uiimageview alloc] initwithimage: ttimage (@"Bundle: // uiscrollviewbg1.jpg")]; Bgview. Frame= Cgrectmake (0,0, Scrollview. Frame. Size. Width, scrollview. Frame. Size. Height); [self addsubview: bgview]; [bgview release];
Set the background image in uiscrollview
Uiimageview * bgview = [[uiimageview alloc] initwithimage: ttimage (@"Bundle: // uiscrollviewbg.png")]; Bgview. Frame= Cgrectmake (0,-100,320,100); [_ Scrollview addsubview: bgview]; [bgview release];
Reprint please explain the source: http://www.cnblogs.com/hubj/archive/2012/05/22/2513254.html