I have 2 UIViews both with a bit off code in them.
I can subclass one to a UIViewController like this self.view addSubView:_msgView];
_msgView being a UIView.
Now _msgView is a Plain UIView that has a 0.7 Alpha to lay over the UIViewController.
now I have another UIView called menuButtons and I want to put that on top of the _msgView.
I was thinking I could use [_msgView addSubView:_menuButton]; but that does not work and gives a warning
Incompatible pointer types sending ‘MenuButtons *__strong’ to parameter of type ‘UIView *’
How do I put a UIView on top of another UIView?
//EDITS:
#import <UIKit/UIKit.h>
#import "SlideMessageView.h"
#import "definitions.h"
@interface MenuButtons : UIView
{
UIButton *onBack;
UIButton *onForward;
UIButton *onRefresh;
UIButton *onHome;
UIButton *onSafari;
UIButton *onChrome;
UIButton *onPocketReader;
UIButton *onSavePDF;
UIButton *onPrint;
UIButton *onShare;
SlideMessageView *msgView;
BOOL viewVisible;
}
The UIButtons have their @properties set below that.
you do 1 thing.. if u are generating both the views through code then add both views in self.view itself and set their frames separately.
i.e if 1st view is at top set the frame msgview.frame = CGRectMake(0,0,320,100);
ans for second view someview.frame = CGRectMake(0,100,320,200);