UITableViews inside UIScrollView

Discussion in 'iOS Programming' started by LainOTN, Sep 27, 2010.

  1. LainOTN macrumors newbie

    Joined:
    Sep 27, 2010
    #1
    I have two (parallel) TableViews inside a ScrollView: each of the TableViews have the necessary height to accommodate all elements (and scrollEnabled = NO), And the scrollView has Vertical scroll enabled and horizontal disabled. At first everything works if I click in an item didSelectRowAtIndexPath is fired in the corresponding tableView but if I scroll down the new visible items don't fire didSelectRowAtIndexPath. If i scroll to the initial scroll state (top) the items do fire didSelectRowAtIndexPath.

    I can't imagine what is the problem...
     
  2. LainOTN thread starter macrumors newbie

    Joined:
    Sep 27, 2010
    #2
    Made some research:
    Actually I have The two UITableView are inside an UIView and its the UIView the one that is added into the UIScrollView. I've made some research and the UIView is not resizing properly, (Set the subview clip off and found the problem) The UIView is smaller than the TableViews but I'm not able to resize the view...

    Code:
    	
            CGRect frame = self.view.frame;
    	frame.size.width = width;
    	frame.size.height = newHeight;
    	self.view.frame = frame;
    	[self.view setNeedsLayout];
    	[self.view setNeedsDisplay];
    
    newHeight is the height of the taller UITableView.
    But the View is not resizing.
     
  3. LainOTN thread starter macrumors newbie

    Joined:
    Sep 27, 2010
    #3
    Solved, Too deep view hierarchy, i review all the code again and found which view was not resizing properly.
     

Share This Page