Reputation: 2002
In my app I take a picture then I add on this picture weather forecast and position with some UILabels and some UIImageviews. For now I'm getting picture like this:
But I will create something like the following picture:
Does anyone ions how to do a stuff like the second picture? In other word I've to create a transparent section in which I will show the weather forecast, the position and the date. I hope you can help me
Upvotes: 2
Views: 86
Reputation: 1
Maybe you should try changing the background colour of the view. For example make it black and add an alpha value.
For Example:
[yourview setBackgroungColor = [UIColor colorWithRed:<#(CGFloat)#> green:<#(CGFloat)#> blue:<#(CGFloat)#> alpha:<#(CGFloat)#>]];
Upvotes: 0
Reputation: 4005
You can add the view layer for achieving this kinda effect in your view controller like i would do if i have to
Upvotes: 0
Reputation: 4271
If you simply want to set a backgroundColor
with transparency (not translucency), you assign background color like this:
yourView.backgroundColor = [[UIColor darkGrayColor] colorWithAlphaComponent:0.5f];
If this is inside UIImagePickerController
, you might want to check out the cameraOverlayView property of UIImagePickerController`.
Upvotes: 0
Reputation: 12951
Wherever u set the view, just add this for example:
yourView.backgroundColor = [UIColor darkGrayColor];
yourView.alpha = 0.5;
U can change the background color to whatever u want...
Notice!
The alpha
will effect also the subviews
of yourView
.
So u can play with it, with some views with transparent backgrounds above yourView
..
Good Luck!
Upvotes: 0
Reputation: 5164
You need to create this hierarchy to create view.Set Alpha as you want.
Upvotes: 5