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.
Related
Cell in iOS6 has rounded corners, while in iOS7 is a rectangle.
I have been working for more than a year, but the problem has been bothering me, if you can help me, I would be very grateful!
This is the new style, this is how it looks in iOS7+. If you wish to change this, you need to create custom cells that have UIViews inside them that you can modify.
You will need to add spacing on the left / right and will need to manually round the corners of the first / last cells.
However, as I mentioned, this is the new style. You should try find a way to make the new style work in your app rather than forcing it to look like the old iOS
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 notice that footer of UITableView section (in static UITableView) appear on left instead of Centre as it used to be before.
I have no problem if this the normal behaviour in iOS 7.
Thus, my question is, is this the normal behaviour? if not, could I change it.
Yes, this is normal behavior. In iOS 7, footer text is left aligned for both plain and grouped UITableView styles.
Yes this the normal from iOS 7.0 onwards.
Ideally you should not try to change the normal behavior!!
Since it is already answered that it is a normal behavior, try aligning your UI design to the same.
I'd like to design a view like this:
Each "section", which looks like a two-cell section in the mockup, are actually or should behave as a whole, I mean, both the blank upper part and the lower part with the disclosure indicator should be an only tappable unit and navigate to another view, I drawed it like two cells because I need the disclosure indicator to be vertically aligned to the bottom.
Should I set two grouped table views with three sections each one? Is it possible to change the corner radius of a grouped table, the space between sections and the right/left margins of the table? And change the alignment of the disclosure indicator?
Or should it be better to design a view like this with buttons? Is it possible to put a custom disclosure indicator in a button, or such symbol is only intended to appear in table cells and may break the iOS Human Interface Guidelines?
Thanks!
Collection views is the best for this.
Each little box with be its on UIView, reminds me of the card app they created in iTunesU, coding together.
Hope that helps.
UICollection view is the best but if you need to support iOS5, in that case you can use plain UITableView create a custom UITableViewCell with the contentView you want with appropriate padding.
I made something like this some time ago.. There are 2 options for you to develop this..
If you are supporting iOS 5.0 and below then you can make a grid view using TableView. (The code is in this tutorial http://www.edumobile.org/iphone/iphone-programming-tutorials/images-display-in-gridview-on-iphone/). Customize it a bit for your button and ImageView size.
If you are only supporting iOS 6.0 and above then you can use CollectionView and then customize it according to your needs.
I'm trying to create UITableView with vertical gridlines, using method described here: http://www.iphonedevx.com/?p=153 . Everything works fine, until I switch table style to grouped.
Vertical lines just don't appear on the table, though overridden drawRect: is still called.
What am I doing wrong? Is there some major difference between cells for grouped and plain UITableView? Is it possible at all to draw primitives on the cells for grouped tables?
Thanks in advance.
PS: I'm using XCode 4, iOS SDK 4.3 and running the project with iPhone 4.3 simulator.
Just looking for the same. Found this guy's blog. It looks promising. He uses a custom png with the grid to complete the effect.
OK, I've found a solution myself.
I've subclassed UILabel, which represents a single cell in a grid. Override of drawRect: draws path with rounded corners and fills it with desired color. Background color of a label is set to clear color, otherwise no rounded corners for me.
Then I've subclassed a UITableViewCell that adds labels to itself. To simulate margins it adds offsets to labels' frame.origin.x and frame.origin.y.
All this stuff contained in a plain UITableView, but with margins and rounded corners it looks like a grouped one.