I’m creating an app just for learn Swift and I would like it to have the translucent appearance could some one to tell me what are the steps or maybe point me to an OS X tutorial/book where this is explained?
Yeah, its covered in a few tutorials. But quite simply setAlpha of the image to a lower number like 0.5.
Thank you so much marciokoko for the replay.
Do you know if there a way in Swift and OS X to display (and hide) an image as background programmatically?
Sure, there are a few approches:
- Give the image an alpha value to make it transparent
- Shrink the image
- Offset the image off-screen so as its not visible
- A combo of all of the above PLUS removing the image from the view hierarchy
The latter being the best option because you are freeing memory by actually removing the image. This of course has a downside which is that it will take “longer” to draw the image back on screen. It depends on the size of the image and the resources available on the device.
Do you just want to make it disappear and never re-use it again? If so, just remove it and throw it away. Of course removing it in a nice UX way is best, so you may want to fade it, shrink it, offset it and then throw it away.
Thank you for your help.
About to have the window transparent
I tried various combinations, unfortunately I cannot got to have the window transparent. Maybe the transparency can be applicated only to some specific elements, like shown in this Apple’s document: Apple Developer Documentation
About to show and hide programmatically an image
What I actually like to do is to create programmatically an image view, not to show and hide a existent imageView, this because I would like to prefer to not have a imageView in the storyboard canvas when I work on the interface of the app.
Anyway, thank you so much again for your help.