Tuesday, 3 December 2013

How to change table view height according to the content size?

For changing the table view height according to the content size


- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
   
    CGRect frame = self.listOfSets.frame;
    frame.size = self.listOfSets.contentSize;

self.listOfSets.frameCGRectMake 
                        (self.listOfSets.frame.origin.x ,  
                         self.view.frame.size.height
                     
                   (self.listOfSets.contentSize.height+80),
                    self.listOfSets.contentSize.width
                    self.listOfSets.contentSize.height);
   
}

No comments:

Post a Comment