Create Translucent UIView

3

I need to create a new translucent screen (UIView) in my iOS 7 iAD-style app, but my problem is that I have no idea how to look for it.

What I've found so far are old things, with many DEPRECATED methods or creating XIB and using QUARTZ.

OBS: More or less in the model below, but translucent equal to View of iOS7 notifications.

    
asked by anonymous 08.04.2014 / 01:08

3 answers

1

Take a look at link

You can play a lot. You create a view controller the way that you and the storyboard you arrow the Storyboard ID to be able to instantiate it in the code, in the example below: "nav".

To open a new View Controller within the Form Sheet:

UIViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"nav"];

// abre o novo view controller
[self mz_presentFormSheetController:vc animated:YES completionHandler:^(MZFormSheetController *formSheetController) {
   //seu código
}];

The MZFormSheetController automatically leaves the background translucent and performs the animations as they appear and disappear. You can set up a few things, such as leaving the background blurry:

[[MZFormSheetBackgroundWindow appearance] setBackgroundBlurEffect:YES];
[[MZFormSheetBackgroundWindow appearance] setBlurRadius:5.0];
[[MZFormSheetBackgroundWindow appearance] setBackgroundColor:[UIColor clearColor]];
    
29.04.2014 / 11:00
3

To make the UIView only translucent, you only need to set the alpha property of UIView to a value less than 1 .

One solution to achieving the effect shown in your image is to create a UIView with alpha < 1 serving as an intermediate mask between the UIView in the background and the UIView in the foreground ( foreground ).

There is also another effect called blur that has been heavily used lately (especially after the release of iOS 7). The creation of this effect is more sophisticated than the previous case, however there are several tutorials and open source tags available on the internet that deal with the subject.

    
08.04.2014 / 02:19
1

If it's really the blur you want, just "steal" the layer from a UIToolbar, according to this tutorial here: link

    
15.04.2014 / 07:17