【发布时间】:2013-11-14 18:01:17
【问题描述】:
有人知道为什么 myscrollview 会重复显示 UIRefreshControl 吗?
UIRefreshControl *refreshControl;
refreshControl = [[UIRefreshControl alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
refreshControl.tintColor = [UIColor grayColor];
[refreshControl addTarget:self action:@selector(updateTableScroll:) forControlEvents:UIControlEventValueChanged];
[_myScrollView addSubview:refreshControl];
[refreshControl setAutoresizingMask:(UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleLeftMargin)];
[[refreshControl.subviews objectAtIndex:0] setFrame:CGRectMake(0, 50, refreshControl.frame.size.width, refreshControl.frame.size.height)]; //padding in Y axis
ImageLink-> https://dl.dropboxusercontent.com/u/14600481/Untitled-1.png
【问题讨论】:
-
您是否可能以某种被多次调用的方法创建此刷新控件?像 viewWillAppear 之类的?
-
-(void)viewDidLayoutSubviews 初始化 UIRefreshControl 的最佳函数是什么??
标签: xcode uiscrollview uirefreshcontrol