Monday, 15 March 2010

ios - UIRefreshControl doesn't show spiny when "Adjust Scroll View Insets" is deselected -



ios - UIRefreshControl doesn't show spiny when "Adjust Scroll View Insets" is deselected -

i have uiview uiscrollview , content view embedded in uinavigationcontroller. added uirefreshcontrol scroll view.

at first had problem content shown in wrong position, not set in interface builder. @ time, refresh command still working fine without problems.

but after had solved first problem deselecting 'adjust scroll view insets' in attributes inspector of view controller, refresh command not show spiny more. tried changing scroll view's inset @ origin of refreshing didn't help. here's code wrote:

in viewdidload:

uirefreshcontrol *refreshcontrol = [[uirefreshcontrol alloc] init]; [refreshcontrol addtarget:self action:@selector(beginrefreshingview) forcontrolevents:uicontroleventvaluechanged]; [self.scrollview addsubview:refreshcontrol];

then in beginrefreshingview:

[self.scrollview setcontentinset:uiedgeinsetsmake(refreshcontrol.frame.size.height, 0, 0, 0)]; [self.refreshcontrol beginrefreshing];

would great if give me answers or suggestions. maybe there's way solve first problem without deselecting 'adjust scroll view insets'?

ios objective-c uiscrollview uirefreshcontrol

No comments:

Post a Comment