2014-01-21 44 views

回答

0
- (IBAction)sliderChanged:(id)sender { 
    [self.tableView reloadData]; 
} 

胡克你的滑塊到上述方法(價值變化),然後用下面的方法來定義高度:

- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath: 
    (NSIndexPath *)indexPath { 
    return self.slider.value; 
} 
+0

是的,它的工作原理! –

0

近完美,我想要一個獨特的視圖,所以我需要改變:

- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath 
{ 
    //Return the size of each cell to draw 
    CGSize cellSize = (CGSize) { .width = 320, .height = self.slider.value}; 
    return cellSize; 
} 
相關問題