I need to add some effect to background image that will blurring the image in the bottom. Like here on background image :
Does someone know how to do it ?
That's not actually blurred, it's fading out to white. You can achieve this by putting a vertical gradient over the top of the image that goes from 100% opaque (alpha 1.0) white at the bottom to 0% opaque (alpha 0.0) white at the top.
There's a decent gradients tutorial here:
http://blog.apoorvmote.com/gradient-background-uiview-ios-swift/
Create a UIView with required CGRect and then add your UIImageView as subview to the UIView. Now set some gradient color to UIView, this way you can achieve your requirement.
Related
How can i remove the white color in this picture?
[
If your image itself has white background, you should get an image with clear background. If you want the change the bg color of UIImageView you can do it in properties inspector in storyboard. thanks.
I have an icon image that is ontop of a UIView with a black color. I would like to be able to see the bottom view within the outline of the icon image.
Guessing CALayer is the way to go, just not too sure how to use it
Useful information
-Splash Screen Background = gray
-Splash Screen Size = view.frame.size
-Icon image size = 75 x 75
Thanks
If you are using the UIImageView for icon then set its alpha less than 1 i.e. 0.8 or 0.5 as you want the transparency.
Otherwise user the transparent image.
How would I create a gradient bar so that when I pan over it I could change the color?
I could easily add a UIPanGestureRecognizer and get some translation within a UIView, but how would I change the RGB values of a UIColor appropriately?
Instead of using an RGB colour, I would use HSB. Just change the hue depending on the swipe.
If you treat the top of the screen as 0.0 and the bottom as 1.0, as the user swipes their finger from top to bottom, the colour should go through it's full spectrum. Then
CGFloat percentTranslation = currentY / self.view.bounds.size.height;
[UIColor colorWithHue:percentTranslation saturation:1.0 brightness:1.0 alpha:1.0]
I've done this before. The easiest way without doubt is to create a png image and use that.
You can calculate the per pixel colour but it's far quicker to just use an image.
In fact. I created a full colour picker which you can see in my app https://itunes.apple.com/gb/app/game-of-life/id477039315?mt=8
The colour bar in the 2nd screen shot is just a png. And the colour square uses a transparent image that has a black-transparent gradient bottom to top and a white-transparent gradient left to right.
All I do is set the background colour of the image view when the colour is selected on the bar.
I need to make my scrollview to be transparent at top and bottom while the underneath text view could be scrolled like shown below.
I made one .png image in photoshop with gradient (black on top) and transparency at bottom.
When I added the image onto the Image view that is atop the scorllview, and run it on the simulator, the whole image is pure black and transparency gone.
Can someone please advise?
Set your imageView's background color to clear.
Also, wouldn't the image you need be white on bottom and transparent on top, rather than black on top and transparent on bottom?
My mistake... I have saved the image as JPG. not PNG. PNG is working properly. Thanks!
I have a series of images that are centered on top of a transparent background. I would like to add a white border to all of them and I could draw it if I had the path of the border of the opaque part of the image. Is it possible to extract this?