Unnecessary padding in tableview cell iOS? - ios

I am developing an enterprise iOS application that uses splitview to display information. My split view, tabbars are all in place and seem to work fine. I have a tableview in the left pane of the splitview. The tableview has custom cells which contain an image view and several textview (removed textviews in the img) The height of the image view is same as the row height of the tableview and tableview cell. I wish to achieve a row height of 182 points. Even though I have kept all size same I see a padding on the left, top and bottom of the tableviewcell. In the tableview the cells thus appear separated by the background color. The tableview has no separators set. The only problem I see is that the image used inside the cell is only 168 points in height.
I did the same stuff in the detail view in the split view however now I see the table cells occupying the entire area designated to it. The image inside this detail view cell is only 160 points in height yet to I do not see that "padding" effect.
I have attached a sample screenshot, pls let me know where to fix it?

Related

Syncing Two CollectionViews For Navigation

I’m trying to sync two collection views proportionally for navigation. One of the collection views is menu-like and is at the top, and the second is a larger one below. What I would like is for the top collection view to scroll a distance of the width of one cell (the cells are dynamically sized) when the user scrolls the bottom collection view a distance of the main screen’s width. The closest thing I've seen to this effect would be iOS: Custom top segmented control works as expected only when using debugger. What I would like to change is to have the left most cell in the top menu always selected. In addition, when the user scrolls the bottom collection view the width of the screen, a new cell should Replace the left-most cell in the upper menu and be selected. Any help in Swift would be especially appreciated, but ObjC answers are also welcome.

How to set Table view cell to occupy entire screen?

I am working on a project to get custom news feeds from Bing news. I created a custom table view cell and populated various UI items in it. But I am having a hard time to make it occupy the entire screen, it starts from extreme left and ends on the right, leaving large gap from the right margin as show in the image. Can anyone help me out, how to correctly fix it with a detailed explanation of how constraints work in Table views and Tableview cells.
Here' what it looks like in the simulator
Remove previous constraints and add constraint to your UITableView like as shown in below image.
So you UITableView will have 0 margin from edges.
Create a UITableViewController. Just drag drop a TableViewCell into it. Add identifier for that cell and use it. By default it will occupy the whole screen.
In your case I guess you might have added constraints to UITableView. Here what you should do is pin your UITableView to Top,Bottom,Right & Left or make UITableView's width equal to SuperView.

Invisible and not selectable objects in cells scrolling down a long static table view in IB

Actually I'm using XCode 7 and I'm trying to lay out a static table view in IB. I have "sizes classes" ticked (adaptive layout) and the table view is taller than the default square scene of 600x600 points. I can work fine with the cells in the top 600 points of the scene, that is its height.
When I scroll down the height of the scene, I can't select table cells by clicking on them in the scene (but I can in the outline). When I drag any object (e.g. a label) onto one of these cells, it goes into the view outside the cell and when I put the object inside the cell by dragging it onto that cell in the outline, I can't see it on the scene neither move it by dragging (it's like it was behind the cell's content view). May anybody help me?
It's a very weird behavior... I'm getting crazy!
I'm not sure if is the same problem, but I had problems editing statics cells when there are many. So in the size inspector of the view controller I set the simulated size to "freeform" and increase the height to unreasonable levels (2000), and then I can access the bottom cells.
Here a screenshot.

An extra view appears in cell when pressing reorder dragger, why?

I have an UITableView with varying height, and when pressing reorder control, in the cell view structure a new view appears. Normally it is not a problem, but sometimes its height is quite big, and it overlaps, with cell below.
Why this view appears?
How can I get rid of it?
Or prevent to overlap other cells?
This view is part of the reorder mechanism and can't be removed. It is used to hide the cell content while you drag a screenshot view above the tableview.
If you set the cell clipsToBounds as YES, it should prevent it's content overlapping other cells.

UITableView: scrolling outside bounds hides cells

I have an UITableView that does not fill the whole screen, so there is some space at the top and the bottom of the screen. This table uses table.clipToBounds = NO and table.bounces = YES.
But when scrolling the cells outside the original frame of the table, the cells are hidden. I know that's the normal behavior of UITableView to increase performance. But is it possible to define an area at the top/bottom of UITableView within which the cells are not hidden? Or even set a cell property to be "always" visible?
Subviews outside bounds of superview are hidden (table view's cells are also its subviews). That's just how iOS view hierarchy works, not really about performance. And it doesn't make any sense when a subview/cell is displayed on the screen while user cannot interact with it (because it's out of bounds). In particular, table view reuses cells that go out of its bounds, so no, you cannot set a cell to be "always visible".

Resources