ios5 - UIScrollView and UINavigationController not working with iOS 4 -


i have problem uiscrollview , uinavigationcontroller(s) , ios 4. following code works fine ios 5:

 ////////////////////////////////////////////////////////////////////////////////////  /* scroll view */   ////////////////////////////////////////////////////////////////////////////////////  mscrollview = [[uiscrollview alloc]   initwithframe:cgrectmake(0, 88, 1024, 668)];  mscrollview.contentsize = cgsizemake(1850, 668);   ////////////////////////////////////////////////////////////////////////////////////  // first view   ////////////////////////////////////////////////////////////////////////////////////  uiimageview *imgview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:           @"view_bg.png"]];  imgview.frame= cgrectmake(10, 50, 350, 510);  [mscrollview addsubview:imgview];  [imgview release];   mfirstview = [[[firstview alloc]  init] autorelease];  uinavigationcontroller *navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:mfirstview];   navigationcontroller.navigationbar.tintcolor = [uicolor colorwithred:79.0/255 green:143.0/255 blue:0.0/255 alpha:1];  navigationcontroller.view.frame = cgrectmake(25, 65, 320, 480);     [mscrollview addsubview:navigationcontroller.view];   ////////////////////////////////////////////////////////////////////////////////////  // second view  ////////////////////////////////////////////////////////////////////////////////////  uiimageview *imgview2 = [[uiimageview alloc] initwithimage:[uiimage imagenamed: @"view_bg.png"]];  imgview2.frame= cgrectmake(380, 50, 350, 510);  [mscrollview addsubview:imgview2];  [imgview2 release];   msecondview = [[[secondview alloc]  init] autorelease];  uinavigationcontroller *navigationcontroller2 = [[uinavigationcontroller alloc] initwithrootviewcontroller:msecondview];   navigationcontroller2.navigationbar.tintcolor = [uicolor colorwithred:79.0/255     green:143.0/255 blue:0.0/255 alpha:1];  navigationcontroller2.view.frame = cgrectmake(395, 65, 320, 480); [mscrollview addsubview:navigationcontroller2.view];  // add scroll view parent view [self.view addsubview:mscrollview]; 

all is, add scrollview 2 navigationcontrollers (with allocated root view controller) view. using code ios 4 not show right size of viewcontrollers added. viewcontrollers size of whole ipad screen!!!!!

as said, works on ios 5! when change size of views added manually not working, added view fills whole ipad screen!! ideas fix this?

thank in advance!

in code have following

//first view add mfirstview.view [mscrollview addsubview:mfirstview.view];  //second view add navigationcontroller2.view [mscrollview addsubview: navigationcontroller2.view]; 

so guess have change first view code following

[mscrollview addsubview: navigationcontroller.view]; 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -