3
我正在使用UITableView和UIRefreshControl開發iOS應用程序。更改UIRefreshControl指標在iOS應用程序中的初始位置
我想將UIRefreshControl指標的初始位置從默認改爲50px。我寫下下面的代碼。
但是,初始位置沒有改變。它仍然保持原來的狀態。
你能告訴我如何解決這個問題嗎?
CGFloat customRefreshControlHeight = 50.0f;
CGFloat customRefreshControlWidth = 320.0f;
CGRect customRefreshControlFrame = CGRectMake(0.0f,
customRefreshControlHeight,
customRefreshControlWidth,
customRefreshControlHeight);
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] initWithFrame:customRefreshControlFrame];
refreshControl.tintColor = [UIColor blackColor];
[refreshControl addTarget:self action:@selector(onRefresh:) forControlEvents:UIControlEventValueChanged];
[self.tableView addSubview:refreshControl];