UITableView Scrolls Outside of My Uiview

in my view, I added another view (named popupview) for a custom similar animation.

In popupview, I added a table view with it and set some restrictions on the table view.

but t * the available view does not change * , whatever the height is set in xib.

and here is another problem: when scrolls the tableview it scrolls out of the view even the tableview is inserted in the popup view

No problem with the image I used. it has the same height, width as the second uiview popupview

XIB structure:

View1 mainView - table view

View2 PopupView {Orange View}

TableView2 - a table in a popup view

! [enter image description here] [3]

What was the issue and how should i resolve it?

+4
source share
1 answer

Try setting the " clipsToBounds " clipsToBounds to YES . This should prevent the table view from "braking" if the frame of the view table is larger / does not match the frame of your popupview.

But beyond that, the correct way is:

Have you experimented with the Autosizing / Autoresizing-Mask parameters of your views? Your tabular view is a preview (i.e., a child) of your popupview, right? therefore, the table view frame must be scaled (that is, autoresist) in the partition view frame (popupview)! You can configure this behavior either in IB on the "Size Inspector" panel of your table view, or programmatically. You should check the View Programming Guide for iOS .

+6
source

All Articles