How can I add a tableViewCell inside another TableViewCell? - ios

the problem here is that I've got a component thats a cell, and I want to include it in a tableview with some other icons and labels in the cell. Maybe the best solution here would be to include a tableview inside of the cells, with a unique cell in it. I've tried to do it and it worked but when it came to launch another screen when selecting the cell it only worked on the margin where the inside tableview isn't included, how could this be solved? something like this Thanks!

Change the isUserInteractionEnabled property of the inner table view to false.

Related

TableView Cell Not Showing Content and Not Responding To Commands

When working in the storyboard I can add labels and imageviews to a tableview cell but when I run the app they will not show. The only way I can get them to show is if they are in a stackview on a view within the cell. The cell will only not change colors on run time even if the cell's background color is changed in the storyboard. Is there any way I can fix this?
You should give us more insight to your project - that means your code, possibly your storyboard...
It's hard to tell what you did wrong when we even don't know what you did.
Did you connect your objects with outlets?
If you defined your own cells, did you selected them in storyboard?
How about your TableView Delegates?

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

Can I put 2 UITextFields in the same tableViewCell?

Check out this image below, this is what I'm trying to accomplish, but I ran into some problems. The first approach I made was to have an imageView (blue square) and 2 separate tableViews within a scrollView. Each tableViewCell would have textFields inside them. The first issue was when the keyboard came into the view, I would move the view up to make sure the bottom textFields were not covered up. I then wanted to be able to scroll up and down so I could still see the top textFields as well. This didn't work because when I nested the tableView inside the scrollView, The scrollView wouldn't scroll. I was also having a problem with setting the firstResponder to pass from textField to textField on the second table only.
I then decided it would be better to create 1 tableView, and add a custom cell to hold my imageView and two textFields. My question is, is it possible to create that custom cell that will hold my imageView and two textFields? would this be a better approach?
Thanks
Wow, I think your can do it easily by UITableView. All you need to do is customising UITableViewCell.
This is possible using subviews. However, why you aren't considering UIViewController or UIScrollViewController for this design?

UITableViewCell is not available in XIB file in XCode 5

I have just encountered a problem today that I am unable to add a new table view cell to my UITableview.
What I did was I drag a table view cell and drop inside the UITableview area. The UITableview did not take the table view cell but rather the cell become an individual view of the main view.
Clearly see that table view cell is not included in Table View
So my question is, how to create a custom table view cell in UITableview in an XIB file in Xcode 5?
Thanks in advance!
If you have dynamic prototype cell will be added automatically. If not, you can choose how much cell you want to have in inspector on right side of screen.
And make sure when you put it into screen that is inside of your tableview.
I answer this question thinking you are using storyboard. First add UITableView.
Then you can see as this,
If you want to use static cell, select Table View & in Attributes Inspector , in content select Static Cells. I think for your question you should use Static Cells.

How to remove separator in between subclassed UITableViewCells?

I have subclassed UITableViewCell. This class is linked to the following xib, which is just a UITableViewCell with a label inside of it:
If you look closely at the bottom, you can see the divider there. How can I remove this?
Here's what the cells look like in a table view:
edit: My table view controller is a subclass of PFQueryTableViewController from the parse.com service. My apologies for neglecting to mention this.
edit2: I changed the colors of the separators to red and have discovered some very off behavior that might aid in figuring out why this isn't working. There seems to be some spacer on the far left of each divider:
Try to make it from the xib :
Go to xib
select table
make separator None.
You can do this with the UITableView property separatorStyle. Make sure the property is set to UITableViewCellSeparatorStyleNone and you should be good to go.
Set table separator style to none from design or code
It simple.. just Go to the Xib File where you have put the UITableView and right side in the attribute inspector you will find Seperator Option.. just select None in that
OR
You can do it manually with the code
tableview.separatorStyle = UITableViewCellSeparatorStyleNone;
just write this in your viewDidLoad method and it will be done..
Found the problem. When I had adjusted the height of the table view cell to 125 over the usual 44, i had adjusted the height of the view sitting inside of the table view cell, instead of the actual view cell.
Thanks for the help anyways to everyone who provided suggestions.

Resources