0

For this requirement I used [self.veiw addSubView:myview];

Also I set the screen size for myview.frame=(0,40,320,400);

Header and footer sizes are 320x40.

It's working perfectly but the problem is when I present or navigate the views, it's not working: view size it adjusted like 320x480.

Any ideas what the cause of this problem could be?

Jean-François Corbett
  • 37,420
  • 30
  • 139
  • 188
kumar
  • 453
  • 1
  • 5
  • 26
  • your question is not clear, in iOS for tabbar the footer is fixed by default and we need to add header accordingly. What you want? – amrit_neo Dec 06 '12 at 07:28

1 Answers1

0

firstOption As i have understood from your question you want to add a view to the top of the current view.

You can try this: Add something like this to every viewWillAppear function of your ViewControllers.

UIView* myView = [get your view from appDelegate/yourAnyClass];
//and then add to the top of the view
    [self.navigationController.view addSubview:myView];
//It will add the view every time to the topView of your app.

Or secondOption: You can adjust your ViewController's frame. Apple Doc. and add custom view to window in appdelegate [self.window add subView:yourView];.

Community
  • 1
  • 1
HDdeveloper
  • 4,396
  • 6
  • 40
  • 65
  • thanks for your reply.I need not add view as metion above.I need to fix the header and footer fixly throughout the application.If we can see tabbar application.we found the bottom bar is fixed throughout the application.even we applied the navigation also.i need that type of functionality. – kumar Dec 06 '12 at 08:31
  • 1
    You then use custom tabbar, in that case. See the [link1](http://stackoverflow.com/questions/10345426/ios-custom-tabbar) [link2](http://www.martinhoeller.net/2011/05/07/custom-tab-bars/) [more](http://www.cocoacontrols.com/search?utf8=%E2%9C%93&q=tabbar) – HDdeveloper Dec 06 '12 at 08:35
  • but i need only images for our ha – kumar Dec 06 '12 at 08:46
  • but i displayed only images in the place of header and footer.(if i use navigation or tabbar .I cann't give more height other than default heights)I need to give header height is 55 and footer height is 35.My views heights like as header,content,footer(55,390,35) respectively.And i need to design 15 views like that.Every time content is different but header and footers are same – kumar Dec 06 '12 at 08:49
  • 1
    You can adjust your [ViewController's frame.](http://stackoverflow.com/questions/4929578/iphone-how-to-set-uiviewcontroller-frame) [Apple Doc](http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/BasicViewControllers/BasicViewControllers.html#//apple_ref/doc/uid/TP40007457-CH101). and add custom view to window in appdelegate `[self.window add subView:yourView];`. – HDdeveloper Dec 06 '12 at 09:03