i facing weird problem tableview uitableviewcontroller. testing in ios 9.2
i have enabled "refreshing" uitableviewcontroller in storyboard , attached it's ibaction valuechanged. note tableview has section headers using "plain" style , custom height of 45.
the problem expect pull down tableview considerable amount trigger refresh control , start spinning.
however in scenario however, tiny bit of scroll makes refresh control show , start spinning. literally 2 centimeters , make appear. it's weird automatically expands in height though haven't pulled tableview enough trigger refresh.
also note though starts spinning , automatically ends spinning method linked in ibaction refresh control doesn't triggered yet.
for example scrolling , reach top, refresh control show , move tableview down, start spinning, stop spinning. without pulling tableview considerable amount.
note in code, don't have "beginrefreshing" anywhere @ all. don't have "scrollviewdidscroll" or "scrollviewdiddrag" etc methods trigger refresh control.
i have never seen sort of issue @ all.
i can't use custom viewcontroller custom tableview due other reasons, need fix this.
any appreciated!
you can add uirefreshcontrol
programmatically, , work correctly. here simple example, uirefreshcontrol not iboutlet
(i didn't include tableview datasource methods):
#import "viewcontroller.h" @interface viewcontroller () <uitableviewdatasource> @property (weak, nonatomic) iboutlet uitableview *tableview; @property (strong, nonatomic) uirefreshcontrol *refreshcontrol; @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; self.refreshcontrol = [[uirefreshcontrol alloc] init]; self.refreshcontrol.backgroundcolor = [uicolor lightgraycolor]; [self.refreshcontrol addtarget:self action:@selector(actionrefresh:) forcontrolevents:uicontroleventvaluechanged]; [self.tableview addsubview:self.refreshcontrol]; } - (void)actionrefresh:(id)sender { dispatch_after(dispatch_time(dispatch_time_now, (int64_t)(2 * nsec_per_sec)), dispatch_get_main_queue(), ^{ [self.refreshcontrol endrefreshing]; }); } // ...uitableview datasource methods @end
Comments
Post a Comment