Xcode UIRefreshControl以重复形式出现

Xcode UIRefreshControl以重复形式出现,xcode,uiscrollview,uirefreshcontrol,Xcode,Uiscrollview,Uirefreshcontrol,有人知道为什么myscrollview显示UIRefreshControl的副本吗 UIRefreshControl *refreshControl; refreshControl = [[UIRefreshControl alloc] initWithFrame:CGRectMake(0, 0, 20, 20)]; refreshControl.tintColor = [UIColor grayColor]; [refreshControl addTarget:self action:@se

有人知道为什么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->

问题在于您正在
viewDidLayoutSubviews
中创建此视图,该视图可以多次调用。如果希望视图中只有一个刷新控件,则应在
viewDidLoad
中创建该控件并将其添加到视图中,该控件在加载视图控制器时仅调用一次。

您是否使用多次调用的方法创建此刷新控件?like VIEW将出现或类似情况?-(void)VIEWDIDLayoutSubview初始化UIRefreshControl的最佳函数是什么??