iphone - UIScrollView scrolling stops before bottom of content -


the uiscrollview (upon calling button click action) scroll few pixels short of bottom of content size window. problem occurs when called function.

- (void)adjustscrollview {     svscrollablelayout.contentsize = cgsizemake(svscrollablelayout.frame.size.width, cgrectgetmaxy(bottomsubview.frame)); } 

problematic function:

- (ibaction)btndeleteaction:(id)sender {     [self clearsubviews];     //do stuff remove deleted subview     [self displaysubviews];      [self adjustscrollview]; }  - (void)temporarilyclearclasses {     int numberofclasses = [self loadnumberofclasses];     (int i=0; i<numberofclasses; i++) {          uibutton* txtclassdisplaytemp = (uibutton*)[self.view viewwithtag:100+i];         [txtclassdisplaytemp removefromsuperview];          uibutton* btndeletebuttontemp = (uibutton*)[self.view viewwithtag:200+i];         [btndeletebuttontemp removefromsuperview];     } }    - (void)printclasses {     int numberofclasses = [self loadnumberofclasses];     nsarray* classnames = [nsarray arraywitharray:[self loadclassesarray]];      int yplacement = 0;     if (numberofclasses != 0) {     if (noclasses == yes)     (int i=0; i<numberofclasses; i++) {         uibutton* txtnewclass = [[uibutton alloc] initwithframe:cgrectmake(0, 10+(50*i), self.view.frame.size.width, 35)];         txtnewclass.tag = 100+i;         [txtnewclass addtarget:self                         action:@selector(txtclassdisplayaction:)               forcontrolevents:uicontroleventtouchupinside];         deleteallbuttonyplacement = cgrectgetmaxy(txtnewclass.frame)+10 ;          uibutton* btndeleteclass = [uibutton buttonwithtype:uibuttontypecustom];         btndeleteclass.frame = cgrectmake(10, yplacement+10+(50*i), 70, 35);         btndeleteclass.tag = 200+i;         [btndeleteclass settitle:@"delete" forstate:uicontrolstatenormal];         if ([self editingstatus] == off)             btndeleteclass.hidden = yes;         [svscrollablelayout addsubview:btndeleteclass];               if (cgrectgetmaxy(txtnewclass.frame) <= svscrollablelayout.frame.size.height) {             svscrollablelayout.contentsize = svscrollablelayout.frame.size;             }             else {                 while (cgrectgetmaxy(txtnewclass.frame) > svscrollablelayout.contentsize.height) {                     svscrollablelayout.contentsize = cgsizemake(svscrollablelayout.frame.size.width, svscrollablelayout.contentsize.height + 5);                 }             }         }     }     else {         txtnoclasses.hidden = no;         btneditclasslist.enabled = no;         btneditclasslist.alpha = 0.4;     }      float centerhorizontal = self.view.frame.size.width / 2;     float deleteallbuttonxplacement = centerhorizontal - (93/2) - 3;     nslog(@"%f", btndeleteall.frame.size.width);     [self refreshdeletebutton:cgrectmake(deleteallbuttonxplacement, deleteallbuttonyplacement, 93, 44)];      [self adjustscrollview]; 

}


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -