我在Storyboard的視圖控制器中設計了一個原型單元格,但不幸的是單元格中的UISlider
未滑動。UISlider不能在原型單元格中滑動
注意: - Autolay爲此故事板啓用。
設計: -
這裏是代碼: -渲染單元在UITableview
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell;
if(indexPath.row!=self.arrSelectRecipientsImages.count-1)
{
cell = [tableView dequeueReusableCellWithIdentifier:@"selectReciptenceTabCell" forIndexPath:indexPath];
}
else
{
cell = [tableView dequeueReusableCellWithIdentifier:@"selectNearbyTabCell" forIndexPath:indexPath];
UISlider *sliderNearby = (UISlider *)[cell.contentView viewWithTag:199];
lblDistance = (UILabel *)[cell.contentView viewWithTag:190];
sliderNearby.userInteractionEnabled = YES;
[sliderNearby setThumbImage:[UIImage imageNamed:@"NearbyCircle"] forState:UIControlStateNormal];
[sliderNearby addTarget:self action:@selector(sliderNearbyAction:) forControlEvents:UIControlEventValueChanged];
}
return cell;
}
我認爲'didSelectRow' touch委託與滑塊觸摸衝突。 –
滑塊應該在表格視圖中工作,請詳細描述問題。 –
問題非常簡單,滑動滑塊時不會滑動。@ A-Live – Vizllx