Text not appearing in tableview controller - ios

I have a tableview controller as my initial view. I added some text into it and it's not appearing. First i added some labels, and none of them was appearing, i thought maybe it was a constraint problem. So i added constraints and still didn't work. Then I made the cells basic rather then custom. In basic, it gives you text for you. And still the text isn't appearing. How can i fix this?
Note: This is a new project, I have tested this on a real device and have the same issue.

The table is created with the default prototypes of cells (Content field is Dynamics Prototypes) that need to create and add from the code. If you want to make a static cell, you need to do this in storyboard:
Select TableView
Set Content field in Attributes Inspector to Static Cells
Add your labels to Static cells

Related

UITableViewController with static cells: invisible cells when keyboard shows

I am using a UITableViewController with static cells, as a user details form. Everything works, until I tap in one of the cells's text field, the keyboard (or custom inputView) shows up, and you scroll the table down. Cells are then not shown, instead a blank space is shown. Scrolling up and back down then correctly shows them.
If I scroll the tableview down until the "geboortedatum" field shows up,
and press on that textfield, a custom inputView with a date picker shows up:
Now, if I scroll the tableview down, the next rows show up blank:
Two rows are supposed to show up there, like this:
It's not related to the inputView with the date picker, the same happens when the plain old keyboard shows up and you scroll the table down.
I have not overridden any of the tableview delegate or datasource methods apart from showing custom headers (but the problem is the same when I remove that), and am not using UITableViewCell subclasses, just static cells in a storyboard. It seems like an iOS bug to me, but is there any way to work around this?
I think I found the cause and the solution. The problem is that these last 2 cells don't actually fit in the storyboard design:
They are there of course, just not visible by default. If I change the storyboard to freeform with a custom height to make it all fit, like this:
Then the problem doesn't show up anymore. The cells are not hidden anymore on scroll, as before. Very strange.

TableView height change in Swift

I'm trying to find a way of making the height of a UITableView change depending on how many rows are in the table being displayed.
I've gone through the site for previous questions but none really come to any conclusion.
Language being used is Swift on iOS 8.
Thanks,
Anthony
Use tableFooterView to pin content to the bottom of a UITableView
EDIT:
The tableFooterView (and tableHederView) can be modified directly in Interface Builder by dragging a view below (or above) the prototype cell(s) in your table view.
I wanted to do this within the IB. The way around it was to drag a new view underneath the prototype cell that was already showing in the IB. Then I could change the size to suit my footer content and then just add the footer parts of the layout to that new view within the Table View.

How to make the dropDown in a UITableViewCell clickable without clickin the next cell and without adjusting the height of the cell?

I have DropDown class (the custom dropDown menu which is a tableViewController)
It is working (tested and used in other classes)
Then I have a PersonalInfo Class..
my PersonalInfo class is a TableViewController containing custom cells
Each cell has a UIView dropDownView and a textField contentTextField.
making the DropDown a subview of dropDownView, I'm able to make the dropDown menu appear on each cell. However, when the dropDown goes beyond the height of the cell, the dropDown items are not clickable anymore but they're still visible.
If i make the cell's height larger it works fine, but I want to keep the cell's height at a certain size.
I tried bringing views to front, never worked.
Can anybody help me? I'm running out of ideas..
thanks
With the drop-down being a subview to your cell, you can only control the content within that cell (I think...). From an "Apple Human Interface Design Guide" perspective, your approach is probably a bit unusual.
Firstly, you wouldn't really need every single cell to have a drop down, right? I mean, even if you have a drop-down menu within a cell, you'd only display one drop down at a time, and not multiple ones. So you could make the drop down a sub-view of the table. Or, more aligned with the standard approach, you would have a drill-down view that loads the drop-down / subtable into the current table, similar to all the tutorials on table views.
Hope this helps,
da_h-man

Custom static table cells in XCode storyboard?

We are trying to teach our designer to create simple iOS apps using storyboards.
One thing we can't figure out though is a straightforward way to have custom static table cells.
Static in the sense that he can add static info to the cells in storyboards (not loaded from a database or anything).
The problem we're having is we can't work out how to make a custom cell with a custom layout.
We can create a custom layout programatically. However, in the storyboard bit doesn't show up the layout (it shows the layout of a standard table cell). So we can't fill in the extra labels and images and such.
Can we make a custom cell so that it will show up in storyboard and let us make static cells out of it?
Thanks
There is a property when you select the table view in the storyboard and you have to change it from Dynamic to Static and then you add the extra labels and images there.

Number of Cell prototypes exceeds tableview height

I have a tableview that has a large number of fairly tall dynamic cells. I've tried creating the prototypes for these but I've run out of height room in the view.
I can't seem to extend the height of the table view, (or the view it's in). I also can't create the tableview outside the viewController, give it a larger height, and just link to it.
Suggestions? I know I can create the cells programmatically or from a separate nib, but I'd really like to do it via storyboard.
thanks,
Just figured this out myself. Try this:
Double-click the table almost anywhere except where there's an existing control. You can also double-click on the outer edge of the table.
Note that the table view will show a highlighted section that aligns with the cell you've clicked. You've entered some sort of selection mode.
Now use the mouse to scroll up or down. The cells will shift up or down as if you were running the app.

Resources