成人午夜激情影院,小视频免费在线观看,国产精品夜夜嗨,欧美日韩精品一区二区在线播放

iOS下uiview和uiscrollview設置背景圖片的源碼

2013-04-14 11:18:15來源:cnblogs作者:@胡子鍋

1.uiscrollview 設置背景圖片

1.uiscrollview 設置背景圖片

// Setup the Scroll View
UIScrollView*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. uiview 設置背景圖片

self.view.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"1.jpg"] ];

3. 個要比較推薦下面幾種

在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];

在uiscrollview設置背景圖片

UIImageView* bgview = [[UIImageView alloc]initWithImage:TTIMAGE(@"bundle://uiscrollviewbg.png")];
bgview.frame = CGRectMake(0, -100, 320, 100);
[_scrollView addSubview:bgview];
[bgview release];

關鍵詞:iOS

贊助商鏈接:

主站蜘蛛池模板: 嘉善县| 吉安市| 宁晋县| 兴隆县| 思南县| 堆龙德庆县| 宜州市| 宽甸| 股票| 葵青区| 芦溪县| 彩票| 桐庐县| 大悟县| 栖霞市| 堆龙德庆县| 轮台县| 肃南| 武清区| 龙口市| 禄劝| 铜鼓县| 涿州市| 新野县| 昌吉市| 泸州市| 舒兰市| 色达县| 临江市| 怀宁县| 宁乡县| 淮阳县| 堆龙德庆县| 墨脱县| 武功县| 宝坻区| 荆州市| 塔河县| 临潭县| 和林格尔县| 长治市|