Issues with container view

↘锁芯ラ 提交于 2019-12-12 03:16:46

问题


I had created a page which has two container views that switch according to a segmented control on top. Basically I hide one of the container views based on what index is selected in the segmented control. Now within one of the container views, I added a table view and a cell. I also created a viewController class for the view contained in one of the containerviews which conforms to the UITableView DataSource and Delegate Protocols.

When i run the app however, the segmented view is not visible and all i can see are empty cells. I am stumped on why the segmented control isn't even displaying. Has anybody ever faced this issue after adding a table view within a container view? What could I be doing wrong?

Edit: Here is what I'm doing in the storyboard. It shows up fine in the simulator because, the table is empty then.

When i run it on the phone, basically, I'm populating the table with a database I create from the nearby places google web api. On the device, it when i navigate to this page, the segment control is not shown and all I can see is the table with the data I'm fetching. The table view basically takes up the whole page. I'm using autoresizing(no autolayout). I checked the constraints I'm providing and everything seems to be fine.

This is what I get when I run the same page on the device:


回答1:


I got it showing. Stupid mistake on my part! The reason why the segmentcontrol wasn't showing was because it was below the container views in the page layout! I just pulled it to the front and it shows up on the device and the simulator. Cheers



来源:https://stackoverflow.com/questions/38852441/issues-with-container-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!