Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

johnmerlino

macrumors member
Original poster
Oct 22, 2011
81
0
Hey all,

Im using storyboard on xcode 4. I created a uiview and put 4 buttons on it. Now I want the uiview to be transparent but the buttons remain visible. Problem is when I set alpha of uiview to 0, the buttons become invisible as well.

thanks for response
 
So what should be visible behind/around the UIButtons? Why not just make your UIButtons subviews of whatever is around them?
 
So what should be visible behind/around the UIButtons? Why not just make your UIButtons subviews of whatever is around them?

because I want to make the buttons reusuable since i have four uiviews that can display depending on a type selected. They all have unique buttons but certain buttons will be reused. Hence, I want a transparent ui view with visible buttons.

Is this possible?
 
You can just go in Interface Builder, and set the opacity of the background color to 0, so then it's gone. Or like Dejo said, set the background color to [UIColor clearColor];

You can set the background to clearColor using Interface Builder, as well, using the color picker drop-down (as seen in the following screenshots):
 

Attachments

  • Screen Shot 2012-05-31 at 8.39.31 AM.png
    Screen Shot 2012-05-31 at 8.39.31 AM.png
    13 KB · Views: 2,955
  • Screen Shot 2012-05-31 at 8.38.49 AM.png
    Screen Shot 2012-05-31 at 8.38.49 AM.png
    53.9 KB · Views: 282
thanks for responses but now I have a new problem. The buttons behind the transparent uiview seem to be not clickable, as if the transparent uiview is blocking it from being clicked.
 
Thanks Dejo for the screenshot :) I was too lazy to do it. Basically, setting the opacity is the same thing, so i thought it was easier to explain.

Next for your question, not 100% sure what the issue is. Do you have something else in that view, something laying over it, accidently pressed the "enable user interaction"?

Gz
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.