views:

29

answers:

2

I have a UIView to which i add a background image. Then to that view i add a scroll view. To the scroll view i add some UIButtons.

I would like to be able to set the scroll view to be transparent (still being able to see the UIButtons) so that i can see the background image underneath it, so that it shows between the buttons.

I have tried setting the scrollview background to [UIColor clearColor] but this doesnt work.

Thanks.

A: 

In addition to setting the backgroundColor to [UIColor clearColor], you also have to set

scrollView.opaque = NO;
Ole Begemann
All i can see is still black underneath it. Thanks.
joec
Are you 100% sure your image is loading?
deanWombourne
Yeah I can see the image around the scroll view thanks.
joec
I can change the color of the view containing the buttons to something like yellow and then I see those changes reflected. But if it clear then all I see is black. Is that the scroll view underneath?
joec
Recreated XIB... must have been corrupted somehow.
joec
A: 

Change the UIScrollView.alpha level to 0.0f

owook
If i did this, my subviews of the scroll view wouldnt be visible would they?
joec
Override the subviews' setAlpha so they won't inherit the parent value.
owook
You can also try changing the alpha level on just the background of that scrollview. I don't think that will affect subviews.
owook