Ios 设置UIScrollView背景图像
我有一个滚动视图,它占据了视图的全部显示大小。我想将背景设置为静态图像。我不想平铺它,所以我认为我不能使用背景色。另外,我并不真的希望它在滚动视图后面(将滚动视图设置为透明),因为我希望bg与滚动视图一起滚动Ios 设置UIScrollView背景图像,ios,uiscrollview,Ios,Uiscrollview,我有一个滚动视图,它占据了视图的全部显示大小。我想将背景设置为静态图像。我不想平铺它,所以我认为我不能使用背景色。另外,我并不真的希望它在滚动视图后面(将滚动视图设置为透明),因为我希望bg与滚动视图一起滚动 任何帮助都会很好。谢谢 只需添加一个与滚动视图内容大小相同的UIImageView即可尝试将可耕地图像设置为背景色 scrollView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"tile
任何帮助都会很好。谢谢 只需添加一个与滚动视图内容大小相同的UIImageView即可尝试将可耕地图像设置为背景色
scrollView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"tileableImage.png"]];
当我们将图像设置为scrollview作为背景时,就会使用scrollview进行滚动。因此,与其将图像设置为背景,不如将图像设置为视图
self.view.backgroundColor = UIColor(patternImage: UIImage(named: "bg.jpg")!)
scrollView.backgroundColor=UIColor(patternImage:UIImage(name:imageName))