我在tableviewcontroller中创建了一个UIRefreshcontrol,如下所示在viewdidload方法中:
refresh = [UIRefreshControl.alloc init];
refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[refresh addTarget:self action:@selector(refreshChatsTableView) forControlEvents:UIControlEventValueChanged];
self.refreshControl = refresh;
Run Code Online (Sandbox Code Playgroud)
问题是,当我把它拉下来一段时间后,桌子会抖动,给人一种非常不愉快的UI体验.有人可以帮忙吗?仅在横向模式下才会遇到此问题.
这是我的代码:
-UIRefreshControl *refresh;
-(void)viewDidLoad{
[super viewDidLoad];
arr= [[NSArray alloc]initWithObjects:@"A",@"B",@"C",@"D",@"E",@"A",@"B",@"C",@"D",@"E", nil];
//refresh control
refresh = [UIRefreshControl.alloc init];
refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"];
[refresh addTarget:self action:@selector(refreshChatsTableView) forControlEvents:UIControlEventValueChanged];
self.refreshControl = refresh;
}
-(void)refreshChatsTableView{
[refresh endRefreshing];
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return arr.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell =[[UITableViewCell alloc]init]; …Run Code Online (Sandbox Code Playgroud) 我试图通过 -webkit-scrollbar 属性更改滚动条的宽度,但 Chrome 拒绝它,说它是未知属性。知道为什么吗?