어떻게하면 새로 고침 컨트롤의 높이를 설정할 수 있습니까? 새로 고침 제어를 위해 맞춤로드 아이콘을 만들려면 http://www.jackrabbitmobile.com/design/ios-custom-pull-to-refresh-control/ 을 사용하고 있습니다. 내가 새로 고침 컨트롤의 높이 즉 탐색 바 끝과 tableview가 시작되는 곳 사이의 공간을 늘려서 이미지 위와 아래에 공간이 생기게하고 싶습니다. 내가iOS 새로 고침 컨트롤 높이
self.refreshControl = [[UIRefreshControl alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 200)];
를 사용하여 시도
- (void)setupRefreshControl
{
// Programmatically inserting a UIRefreshControl
self.refreshControl = [[UIRefreshControl alloc] init];
// Setup the loading view, which will hold the moving graphics
self.refreshLoadingView = [[UIView alloc] initWithFrame:self.refreshControl.bounds];
self.refreshLoadingView.backgroundColor = [UIColor clearColor];
// Setup the color view, which will display the rainbowed background
self.refreshColorView = [[UIView alloc] initWithFrame:self.refreshControl.bounds];
self.refreshColorView.backgroundColor = [UIColor clearColor];
self.refreshColorView.alpha = 0.30;
// Create the graphic image views
self.compass_background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"compass_background.png"]];
self.compass_spinner = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"compass_spinner.png"]];
// Add the graphics to the loading view
[self.refreshLoadingView addSubview:self.compass_background];
[self.refreshLoadingView addSubview:self.compass_spinner];
// Clip so the graphics don't stick out
self.refreshLoadingView.clipsToBounds = YES;
// Hide the original spinner icon
self.refreshControl.tintColor = [UIColor clearColor];
// Add the loading and colors views to our refresh control
[self.refreshControl addSubview:self.refreshColorView];
[self.refreshControl addSubview:self.refreshLoadingView];
// Initalize flags
self.isRefreshIconsOverlap = NO;
self.isRefreshAnimating = NO;
// When activated, invoke our refresh function
[self.refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
}
그러나 그것은 작동하지 않는 것 : 아래는 내가 코드를 사용한다.