UITableViewCell displays differently in App than in Interface builder - ios

Here is how the tableViewCell appears within the TableVIew in the storyboard. The Cell is a custom made cell in the interface builder.
Here is how the same TableView appears live.
Im wondering what is causing the lives Cell white background to be truncated and turned grey. I would like the entire Cell to look the same as it does in the Storyboard.

Related

UISearchController messes with Layout of Cells

I am using a UISearchController in my application following this tutorial:
Now having set up a custom UITableViewCell. The UISearchController messes with my cells.
It seems like the UISearchController is not using the same custom UITableViewCell and it's view bounds differ from my own UITableView. Is there a way to change this back, when I press the cancel button?
Edit:
Though, nobody has answered, I found a solution:
make sure, your cell is connected to the actual tableView, not your primary only. ( I have used an Outlet and set only the cells of my outlet )
make sure you ALWAYS address the outlets in your custom cell. Since I used this
cell.textLabel?.text = "Hello"
my cell will automatically be cast to the default cell.

Accessibility not working properly on UICollectionView inside UITableViewCell

in my app i have a UICollectionView and UIPageControl inside UITableViewCell. UICollectionView has three different kind of cells and each cell covers the full width of iPhone. With accessibility on we are facing a problem when the focus is on UIPageControl and we try to adjust its value by swiping up and down and then traverse back to the cell it loses its focus and takes us to some different cell instead of taking control to the cell which we have changed using UIPageControl.
We are changing the cell on value change event of UIPageControl.

UITableViewCell selection behaviour changes when selectedBackgroundView is set

I have a UITableViewCell which is loaded from a xib, with a handful of labels and image views. I notice that when the .selectedBackgroundView property is set (in -awakeFromNib), interaction with the cell is only possible when touching on the labels or image views within the cell.
Trying to touch any blank space in the cell does nothing. Not setting .selectedBackgroundView returns the behaviour to normal.
Does anyone have a fix for this? (Mine currently is to place an empty UILabel over the entire contents of my cell)

UITableView : click in blank area will not trigger didSelectRowAtIndexPath

When I am developing iOS8 Today Extension, I set a UITableViewController as the
main view controller.And I met this problem:
When I init the UITableViewCell using initWithStyle:UITableViewCellStyleDefault
in cellForRowAtIndexPath, the whole area of one cell can trigger didSelectRowAtIndexPath
normally. However when set UITableViewCellStyle to UITableViewCellStyleValue1,
UITableViewCellStyleValue2 or UITableViewCellStyleSubtitle, I can only trigger
didSelectRowAtIndexPath by click in detailTextLabel or imageView's area. Click in other blank
areas will get no respond.
I've tried to set tableview's delegate to self, set detailTextLabel and imageView's
setUserInteractionEnabled:false in cellForRowAtIndexPath, and all these do not work. Does
anyone have any idea about this?
P.S. I am not using storyboard or xib file,just code.
I've found a same problem on Android:
I'd like to click anywhere (blank area) in a list view
I encountered this myself while trying to display UITableView inside the TodayView. Although I don't know why is this happening, I found out that this only occurs when the UITableViewCell background is clearColor. If you set the background to some other color, didSelectRowAtIndexPath will be called. However, here's a quick workaround - put UILabel to stretch on whole area of the cell's contentView and then the delegate method will be called every time. Anyway, it seems like a bug.

MPMoviePlayerController reuse in a custom UITableViewCell

I am working on creating a table where each cell has a play button and a MPMoviePlayerController. It is setup so that I have custom UITableViewCell class that loads a .xib. Just to make sure the cells are being reused correctly, I have the tableView Controller set a number for the button title (whatever the indexpath.row is). This displays correctly, but when I play one of the cell's videos and scroll down quickly it appears again in another cell. How can I resolve this?

Resources