Empty cells in InAppSettingsKit settings window - ios

I need to show settings screen within my app, so I use InAppSettingsKit to implement this. I use storyboards in my app, so I created a UITableViewController with IASKAppSettingsViewController super class. In this class I didn't implement any other special methods except settingsViewControllerDidEnd:. The problem is I need to hide empty cells in my table view (I have only two parameters in settings, so the whole remaining screen is full of empty cells). It means that the remaining part of the screen should be just empty, without empty cells, and with grey background (as in Settings.app).
I can make UIView with empty frame as footer view of UITableView, but it's not the best solution - background color of footer remains to be white as in normal table view. What's the best way to limit number of cells?

I set the Style property for my UITableView to Grouped in Interface Builder, and it resolved my problem.

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.

How to make cell doesn't scroll along with other cell?

I am making an app that use table View Controller and static cell.
I want to make first cell don't scrolling while other can. This is a picture of what i am talking about.(Sorry for my bad English)
For example as in this picture, I want to make 9gag tab stay when scroll. If you play instragram you will see that when you scrolling the name of user will stay until you scroll into another one. However I want it to stay not changing when it encounter second cell.
Any suggestion?
Using UITableViewController would not help here. You can use these steps to get what you want:
1. Create a UIViewController.
2. Add UITableView as its subview.
3. Add another UIView as UIViewController's view's subview.
4. Using auto layout constraints, you can put UIView above UITableView
This way, you will get a sticky view at the top.
Ok, not exactly sure what you're after but i'll take a stab.
Firstly, if you want the section to remain in place until a new section of items is present, you just need have a look at sections. This is an automatic feature. You may not see it occur until you have plenty of items in the sections.
UITableView With Multiple Sections
There's plenty of stuff about it & not too hard to implement.
My other guess of what you want:
If you want it to remain static regardless of anything, perhaps you could just create a view and place it above the table view. why does it need to be a part of it if it doesn't change?

Is is possible to control the speed and scrolling of a UITableView

I've got custom tableview cells that are 170 px tall. Including the table header I can see two complete cells and a portion of the third. When I scroll the tableview, the cells shift up but do not stop until a portion of the third is above the table.
Is it possible to change the way the table scrolls and allow me to see all of the third cell. A video illustrating the issue is available at https://youtu.be/iuhuR_wDe90
Images of the issue:
It seems you have enabled 'pagination' on your UITableView.
You can get rid of this in Interface Builder, in the Scroll View section there's an option called 'Paging Enabled' which should be switched off.
If you don't use storyboards, tableView.pagingEnabled = NO; will do the trick as well (though it is NO already by default).

UITableView Thinks it is Taller than it is when use as inputView

For a custom widget, I want to display a list of items in the modal slide-up way that you get from setting a view as the inputView on a widget (that is, it replaces the keyboard for that widget).
I can do this with no issue, but when I set a UITableView as the inputView, it seems to think it is taller than it is. I can scroll all the way past the bottom so that the last item is not even displayed. When there are fewer items than fill the area it adds blank rows way past the bottom of the visible area as well.
Is there something about the inputView area that causes stuff to not know how tall its container is? Is there a workaround?
So, instead of using a UITableViewController, we wrapped it (in the storyboard) in a normal UIViewController with a table view in it, and that seems to be working fine.

Kind of complicated custom UITableViewCell

I have a particular goal in mind here, searching for it is a little hard. I am trying to accomplish this (This is a photoshopped screenshot):
I have everything in this view working, except for the split row for the Company Name/ Beginning of the field row. The "Company Name" field is just a textfield, all I really want to do is shrink that neato cell background to just go behind the right side.
Create a custom table view cell that has two subviews: the text field on the left and a UITableViewCell on the right as a subview of the main table view cell. A UITableViewCell is just a UIView so you can actually add it as a subview of any view. The main table view cell will have it's background color set to transparent.
So totally complicated custom cell comes with a totally ridiculous solution. I built a view for the cell that has the one field...and another UITableView.
That second UITableView has the "Beginning of the field" text, and its cell gets the background, and I hide the background of the main cell.
I had to play around with the nested table's size and position to get the row to display properly, and make sure that the lines in the background don't shift when it hits the nested table, but it came out perfect
You could try setting the frame property of your cells backgroundView to cover only have your cell's width. Address Book handles complex forms like this with a nice look and feel--you might want to see what they've done there..
One approach would be to define a custom table view cell, set its background transparent and add the UITextField on the left and a UIButton on the right (customize it to look like your other cells), as in your screenshot.

Resources