Sunday, October 3, 2010

Adding uiview to a uiviewcontroller

Programmer Question

I'd like to add a 50x150 uiview that I will be using as a menu, and I want to overlay it on top of my uiviewcontroller. So far what I've done is declare a UIView IBOutlet in the UIViewController class file, and in that UIViewController xib file, I dragged a UIView from the library and hooked it up accordingly. Problem is its not showing up when trying to call it:



menu = [[UIView alloc] initWithFrame:CGRectMake(10,10,50,150)];
//[self.view insertSubview:menu atIndex:0];
[self.view addSubview:menu];
//[self.view bringSubviewToFront:menu];


I've tried different variations as you can see, all suggestions from other posts but I get nothing. Am I going down the wrong path here? What am i missing?



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails