0

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. enter image description here

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:

enter image description here

Jobs
  • 628
  • 7
  • 27
  • Could you post some pictures ?, is the container view under the segmented control ?. – Santiago Carmona González Aug 09 '16 at 13:45
  • incorrect auto layout constraints maybe? hard to say without any code / other details – kambala Aug 09 '16 at 14:09
  • @Santiagocarmonagonzalez I made a edit with some pictures. – Jobs Aug 10 '16 at 06:45
  • @kambala I'm using autoresizing. I've put in some edits explaining what is happening exactly. I didn't share any code because I'm not doing much in code with the container views except hiding and unhiding the views. The view with the table just has the tableview protocol implemented. – Jobs Aug 10 '16 at 06:48
  • Are you trying to show two different tableViews or only one is a tableView? In both the cases, I have done it programatically if you need a code guidance. – amagain Aug 10 '16 at 06:51
  • @amagain Ultimately in the design I have, I'll be adding in two table views with a search bar on top for both the views. Did you face any similar issues when you implemented your code? – Jobs Aug 10 '16 at 07:08

1 Answers1

0

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

Jobs
  • 628
  • 7
  • 27