简体   繁体   中英

UITableView scrolls beyond the bounds of my uiview

in my view i added another view (named popupview) for custom popover like animation.

In the popupview i have added a table view with in it and have set some bounds to the table view..

but the t* able view heigh doesnt changes* , what ever height i set in the xib.

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

No issues with image i have used. it is have same height, width as 2nd uiview popupview

XIB Structure:

View1 mainView - table view

View2 PopupView {Orange View}

TableView2 - table in popup view

![enter image description here][3]

What was the issue and how should i resolve it?

Try setting the "popupview" view's clipsToBounds property to YES . This should prevent the "sticking out" of the table-view, if the frame of the table-view is greater/not the same as the frame of your "popupview".

But aside from that, the proper way:

Have you experimented with the Autosizing/Autoresizing-Mask settings of your views? Your table-view is a subview (ie child) of your popupview, right? so the table-views frame should scale (ie autoresize) to the parrent views frame (popupview)! You can configure this behavior either in IB in the "Size Inspector" pane of your table-view or programmatically. You should check out the View Programming Guide for IOS .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM