开发者

how to extend Background Image in IPhone?

开发者 https://www.devze.com 2023-01-30 01:51 出处:网络
i have a UIScrollView, when somebody click a button, the scrollview will become longer. And i would like to make its background image extended also, which means, the buttom part of the image can b开发

i have a UIScrollView, when somebody click a button, the scrollview will become longer. And i would like to make its background image extended also, which means, the buttom part of the image can b开发者_开发技巧e duplicated. do you guys know how to do it in Objective c?

thanks a lot! penny


I think this will be usefull for you.

you can set the scroll view backgroundColor as follows;

scrollView.backGroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"moviestrip.png"]];

by doing like this, when the scrollView become longer, automatically the image will be duplicated.

or else without duplicating you want to show the image with more width and height as much as the scrollview content, then follow this code.

CGRect rect =  imageView.frame;
rect.size = scrollView.contentSize;
imageView.frame = rect;

by doing like that the imageView will show as much as size of the scrollview.

Regards,

Satya

0

精彩评论

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