As you can see, the layout of the separators above are not correct. The tableView is in the MoreTabController.
I found the solutions as How to fix UITableView separator on iOS 7? and this Is there a way to make UITableView cells in iOS 7 not have a line break in the separator?
But I am compiling my app against SDK 6.0 but not SDK 7.0 as my app cannot run if compiling against SDK 7.0. The function setSeparatorInset only exist after SDK 7.0, any other way I can solve this?
// in ios 7 We can set separatorInset in UITableView Two Way
1) set by Pragmatically
table.separatorInset=UIEdgeInsetsZero;
2) Or u can do this way
The solution could be, set the separator style as None.
Then, add an imageview or uiview (background color gray) with width as the Cell width and height 1 or 2 (depending on how thick you want the separator to be), and then add this view or image at the end of the cell.
This will also help you to set your own separator color.
Hope this helps.
Related
I am having an issue with layouts in custom cells in Xcode in my iOS app since it updating to Xcode 7 and iOS 9 SDK.
On the example screenshot below, the custom cells that I have created with labels inside them are not aligning to the correct default inset/indent that the normal non-custom cells are at.
Specifically as you can see below, the cells in Section 1 are all very close to the left edge (custom cells), as is Cell 0 in Section 2 (Online label is too snug, and the switch is too far to the right), whereas Cells 1-3 in Section 2 (normal default style cells) have the correct default ~15px indent.
Previously it worked correct in iOS8 with Xcode 6.x, but not after the update....how can I solve this?
I found that this issue can be solved by using the accepted solution for this question here! Good luck and happy coding!
UITableViewCell with autolayout left margin different on iPhone and iPad
I am in the process of updating an old app from XCode 4.6 to 6.3 and have run into a difference in how my custom table view cells are rendered between iOS 6 and iOS 8 (well the change can be seen in iOS 7 as well).
Here are 2 screen shots from Xcode 4.6/iOS 6.1 simulator:
Here are the equivalent Xcode 6.3/iOS 8.1 simulator:
(As background, the Preferences screen is a grouped UITableView with 3 groups and 1 element per group. The Units screen is a single sectioned UITableView with 3 elements. And the "Note" on the Units image is just a plain view)
The difference I didn't expect (and don't like) is that in iOS 8, the custom table cells have expanded horizontally to cover the entire width of the screen, and have also lost their rounded corners.
I have been looking around to see if/how I can make the iOS 8.1 version look more like the 6.1 version, but so far have failed.
Is it possible to easily get back the layout I want? And if so, where should I be looking to make changes?
One possible approach is to set tableView.backgroundColor and your custom cell's contentView.backgroundColor to clearColor (it can be done via the interface builder as well). Then add a background view to your custom cell. You can give it rounded corners and add space around it.
This is what it looks like at runtime (the blue background belongs to the view behind a tableView):
This is more tricky though when we deal with a group of cells on your right screenshot. There the first cell has to have rounded corners at the top, the last one has to have rounded corners at the bottom, and the middle one shouldn't have rounded corners. I guess, it can be done (you could take indexPath into account when configuring the cell), but it takes a bit more work.
P.S. I'm sorry for the size of images. I don't know how to restrict it.
I have an app that has a list of UITableViewCells. By default, the cells are set to a certain height (lets say 100) to show only some basic information. When the user clicks on a cell the height changes to 150 to show more actions that were previously not seen. This works without a problem on iOS 7.0.0-7.0.5. I'm testing on an iPhone 5s running iOS 7.1 beta 5 and seeing some drawing issues with the cells.
Here's how it looks on iOS 7.0... versions which is what is expected. When the cell is collapsed, the buttons that are positioned past the height of the cell are hidden and when the cell is expanded to a height to show the buttons, they are visible.
Cell expanded:
The following is the cell when collapsed:
Here are the issues I'm seeing with iOS 7.1 beta. Im curious if this is just something that is a problem with the beta or if I'll have to rethink how this is being coded currently. As far as I can tell this has been present since the first beta of 7.1.
As you can see, the button which was previously hidden is now still showing even though the cell is collapsed.
Is this an issue with the beta that anyone else has seen or is this expected behavior now? Thank you for you help!
Try setting clipsToBounds=YES in your cell as it may be drawing outside of it bounds.
cell.clipsToBounds =YES
Also check that the cell height is actually collapsed.
I have an app which was designed for iPad and iPhone. For iPhone everything is ok but in iPad version for the iOS6 platform there is an extra space from the left and right sides of the cell - in iOS7 it's ok. You can see them in storyboards on the next screenshot:
and the sizes for the cell:
How can I remove this extra space ?
There is little changes between IOS 6 & IOS 7 for the UITableView grouped(UITableViewCell):
IOS6 :
cell.contentView and cell.view is totally different with their frames .
IOS 7 :
Cell.ContentView is nothing but the Whole View of the Cell .
IOS 6(VIEW):
If you still wants to do with your thought then make it as Plain Style for UITableView OR by Subclassing the cell.
NOTE: This is not an answer for your question. Its just the way to suggest
Are you using table type group ?
Try changing the UITableView type from group to plain.
I discover that in a iOS7 UITableView (in plain and in grouped style) is the same set the separator style in UITableViewCellSeparatorStyleSingleLineEtched or UITableViewCellSeparatorStyleNone. The table view appears without separator. It's a bug?
No it is not a bug, it is just another victim of the iOS7 flatten UI, just like UIButtons have no borders, and don't forget that etched line does't fit with flat UI.