Frank Williamson
Frank Williamson

Reputation: 1

Overlaying a UIView on a UIViewController

I have an application with 6 view controllers all working fine and switching between each other. However, I want to overlay one of them with a UIView of graphics (Histogram or Line Chart, etc) which has a transparent background. How do I do this? Or, alternatively how do I switch from a UIViewController to a UIView and back. There is no interaction from the graphic (UIView) so I could use a modalview. What's the best way to achieve either?

Upvotes: 0

Views: 1035

Answers (1)

zrzka
zrzka

Reputation: 21259

Let's say your overlay view is in overlayView variable. Simply put this line in your view controller ...

[self.view addSubview:overlayView];

... and do not forget to set frame or proper autoresizing mask.

Upvotes: 2

Related Questions