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

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

Related

How to adjust the height of my tableView when my dropdown menu is clicked?

I have a implemented a drop down menu above my UITableView and when I click on it I want my table view to go down inside the items of my drop down menu, because right now when I click on my drop down menu, the tableview stay where it is..
i have a view above my prototype cell that contain my drop down menu but I can't put any constraints on it... when I click in "filtre" I want this to happen : image description here
it looks like you added a Table Header view. it is a little different than common UIView.
Instead of changing Height constraints, you'd better to change the frame of the headerview
how-to-set-the-height-of-table-header-in-uitableview
In addition, you can found good codes of dropdown implementation from these links.
https://github.com/qmathe/DropDownMenuKit
https://github.com/onmyway133/Dropdowns

Switch from UIView to ScrollView in Swift

Originally, the number of menus was one, but it was changed to more than one.
So I want to change the UIView (Container View) so that I can scroll horizontally.
Shop Menu View Cell is TableView -> TableViewCell -> TableViewCell (This) on the screen.
I tried several ways to switch to the horizontal scroll view.
I have separated the Container View and made it into a Cell
I also tried adding Scroll View or UICollectionView.
But all the way was not what I wanted.
Perhaps the Shop Menu View Cell is due to having passed the TableView twice.
I could not solve it for four days.
Please give me a hint how to implement.
To create editable forms of data display for static information, static TableViewController is best choice. As it automatically adjust your view when keyboard appear and other many feature, along with scroll. Plus you can directly outlet all the components to your controller class.
Your view will look something like:

How to add extra table view cells to handle user input?

Recently I have been trying to create a table view with different table view cells. What I want to do is that when users click on each table view cell, it shows an extra cell underneath the selected cell to handle user inputs and the extra section disappears when the cell is unselected.
I am fairly new to iOS development and I am wondering what would be the best way to achieve this. At the moment I am thinking of hiding the extra cells initially and displaying each of them when the cell above is selected.
Any help would be appreciated.
Apple has a great set of sample code that demonstrates the behavior you're looking for — displaying a cell beneath another cell when selected. This behavior is used in Calendar when displaying a date picker, and it's pretty much what you've described.
Question: Will each cell have an identical set of options?
If so, I'd consider including the user inputs as part of the source cell and adjusting the height of the source on selection. You can animate the cell's height changing using tableView's beginUpdates and endUpdates. This way, you avoid messing around with cell indices.

Text not appearing in tableview controller

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

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