Create Uiview Free

Asked

Viewed 207 times

3

I need to create a new screen (Uiview) translucent in my app, in the style of an Iad iOS 7, but my problem is that I have no idea how to look for it.

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

NOTE: More or less in the model below, but translucent equal to iOS7 Notifications View.

inserir a descrição da imagem aqui

3 answers

3

To leave the UIView only translucent, you just need to set up the property alpha of UIView with a value less than 1.

A solution to achieve 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 (background) and the UIView in the foreground (foreground).

There is also another effect called Blur which is being widely used lately (especially after the launch of iOS 7). The creation of this effect is more sophisticated than the previous case, however there are several tutorials and codes open source available on the internet dealing with the subject.

  • I’ll look for Blur I believe that is my goal. Thank you!

1

  • Douglas, Welcome! If possible add here useful link information. As is, and in case the link fails to work the answer is no senido.

1


Take a look at the https://github.com/m1entus/MZFormSheetController

You can play a lot. You create a view controller the way 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 inside 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
}];

Mzformsheetcontroller automatically leaves the translucent background and performs the animations by appearing and disappearing. You can set up some things, like blurring the background:

[[MZFormSheetBackgroundWindow appearance] setBackgroundBlurEffect:YES];
[[MZFormSheetBackgroundWindow appearance] setBlurRadius:5.0];
[[MZFormSheetBackgroundWindow appearance] setBackgroundColor:[UIColor clearColor]];
  • 1

    Good morning @André. I ask you to elaborate more on your answer in order to make it complete. If one day the project goes off the air, we’ll have nothing to answer the question.

  • @Fonseca, I can elaborate more on the answer by giving an example of how to program a Mzformsheetcontroller, but that’s exactly what’s on their github. If one day the project went off the air, patience, another response would come. Just like when a new version of iOS comes out and the old answers no longer serve.

  • @Andrécytryn The project does not need to be discontinued for a response containing only links to lose value. It can change hosting, change ownership, be merged with another project. In addition, adding more details about the project to your response also helps in cases where the original documentation is weak (as is the case here). I edited your answer to give her more body, with more details on the Mzformsheetcontroller. Unfortunately, iOS is not mine, and I may have made some mistakes. You could review it to ensure that it remains correct?

  • @Gabe I agree, but I don’t think in this case the answer is "more complete". We can add the project information here, but it would copy and paste what’s in the Mzformsheetcontroller specifications. We just fell into that old story of giving the fish or teaching how to fish. Anyway your add-on is perfect, this is the basics to get to use the project.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.