UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl setFrame:CGRectMake(0, 0, 320, 10)];
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
NSString *title =@"Pull down to refresh";
NSMutableAttributedString *titleAttString = [[NSMutableAttributedString alloc] initWithString:title];
[titleAttString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"Helvetica" size:12.0f] range:NSMakeRange(0, [title length])];
refreshControl.attributedTitle = titleAttString;
refreshControl.tintColor = [UIColor grayColor];
//UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 50,10)];
//[lbl setText:title];
refreshControl.accessibilityLabel = title;
[objTable addSubview:refreshControl];
No comments:
Post a Comment