UITableViewCell is loading content only on scroll - ios

I am trying to create a UITableView
Here is the code sample
https://www.dropbox.com/s/1t2wnpo110o2r9n/TableBug.zip?dl=0
The problem is , the UITableViewCell only shows 1 cell and shows other cells only after Scroll

OK, after running your code you have one problem.
Because you have an image as a subView of your cell and the image is larger then the cell, some time it will be drawn outside of the cell and hide other cells
So go the StoryBoard and select the table view cell and in the attribute inspector check the "clip subviews" button.
This should solve your problem (it did for me when i run your code)

Related

iOS - How to add subview on top of tableView cell without be covering by the previous Cell

I have a tableivew, I want to add a coachmark on top of the tableview cell. and this coachmark is like a popup.
what I did is uncheck the clip to bonds in this tableview cell so it appeared correctly.
but what happened is when I scroll up/bottom this popup is covered by the previous tableview cell.
so any idea how to solve this issue with making the cell background clear because those cells are colored.
Use followings methods to change z axis distance for your coachmark view
bringSubviewToFront(_:)
sendSubviewToBack(_:) on coachmark or others cells
Example:
cell.contentView.bringSubviewToFront(coachmark)

Getting error on scrolling while used tableview inside collection view

I have added UITableview inside UICollectionViewCell with auto layout and content of table is very large. I'm getting problem while scrolling tableView cell to top and scroll to next collectionView cell. It goes up in screen. Please see attached image on which I'm suffering.
As we can see all content jump to top
This is content on tableview

UILabel could not display correctly in the UITableViewCell

the original pic
after i scrolled the tableview
the green Label is a custom label,i use autolayout(masnory) in the tableview for the cell,
but there is something wrong with the cell that the greenlabel on the cell could not display correctly . but when i scrolled the cell out of the screen,once it appears again,everything is ok.
i have tried some methods such as call [self setNeedsLayout] in the configure cell methods ,but it does not work
Click storyboard and find your label and click it later look at bottom side click Resolve Auto Layout Issues and choose -> Add missing constraints or Update constraints will add auto layer constraints and will look good.
Thanks

Custom UITableViewCell layer cutoff

I have a UITableView with custom cells. In the awakeFromNib of the cell custom class I add the cell labels etc. using AutoLayout. They display fine when viewed first time.
(Blue rectangle is a single UITableViewCell)
The problem is that after I swipe the table view so that some cells goes offscreen then back again (i.e. cells are re-layout) the cell layer gets cutoff.
Another way to debug is to go to Xcode, Click Debug>View Debugging>Capture View Hierarchy on Xcode 6+. It looks like there is possibly an unused view being added to the bottom left corner of your view? Try the view debugging to see if that's the case.

How to create expandable table view in ios?

On click of table cell it will dynamically increase the label height and if user click on another cell previsoly opened cell will collapse and expand selected cell.I was try hard for this bt label text is not working well.I want increase the height of cell.exa- click on question cell it will expand the answer
Connect UITableViewCell to the code behind, have a state for that cell and on didSelectRowAtIndexPath change cell height to whatever value you want. Regarding of the state of the cell ( you can do this by checking its height as well ) shrink or expand the cell.
You can do this by adding another cell below "question" cell and make it visible or hidden on click as well.

Resources