Content of static table view cell not displayed iOS 9 - ios

I'm using xcode 7 beta with iPhone 5s (is beta).
I create a table view (static, grouped, 1 section, 3 rows). Rows B and C are basic style and row A is custom with a label.
On my iOS 9 device row A doesn't display any content, but rows B and C are displayed as expected. If I use another device with iOS 8, row A displays the content correctly (my label with text "A").
Other questions here do not match my problem...
What's the Problem with iOS 9?
Or is it a bug?
Click to enlarge

It's too late to reply but I would like to explain what worked for me. I had the same problem custom cell was not displaying the content of the UITableView.
Just to check where is the problem:
First uncheck Use size classes checkbox and run the project, now you are able to see the content in the custom cell. check again the use size classes checkbox and build the project.
How I fixed: I was working with size classes "width: compact, height: any". So I checked Any:Any in storyboard for custom cell and fixed the constraints and then again I selected "width: compact, height: any" in storyboard and build the project. Now custom cell is desplaying the content.
Note: I am using Xcode 7.3.1

Related

iOS9 / Xcode 7 Custom Cell Label Alignment Issues

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

UITableView rendering differences between iOS 6 and iOS 8

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.

How can I change the size of UI Collection View cells depending on whether it is iPhone or iPad

After creating a universal app on Xcode 6, I have managed to create a UI collection view which displays 2 cells in the width of an iPhone. However when viewed on iPad, it shows 4 cells with lots of padding around the cells.
How can i change the size of cells on an iPad so that 3 cells are shown with minimal padding. I want to leave the iPhone size alone.
So far i have used the storyboard to set the cell size. I have a added a custom cell size of 158pts by 158pts which works perfectly with iPhones. I cannot find this code in the Objective C code. How can I set an individual different size for iPad.
This is what it looks like on iPhone.
https://www.dropbox.com/s/md1sn4z3k78i5s1/iphone.png
and this is what it currently looks like on iPad. The wrong way.
https://www.dropbox.com/s/0x2n9i8v6gvlfnc/ipad.png
I want to get rid of the Grey padding and increase the cell sizes so there are only 3 cells with the same padding as on the iPhone version.
I am a real beginner so any help is much appreciated.
I am answering my own post as I believe that the only way to do this is to use a standard ViewController and place a UICollectionView on top. This way you can add different UICollectionViews for the different Size Classes on Xcode 6.
At this point you can set different sizes for cells on iPad size classes to iPhones ones.
There maybe an easier way to use a UICollectionViewController but i am unaware of it, please let me know below.
EDIT
I have since found out this can be completed using the UICollectionViewController by using constraints and by increasing the cell when used on iPads by code.

How to make the cell wider in iOS6 iPad

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.

ios visually resize image in a table view cell

I am new to ios and am working on creating a table view with custom table view cell. I am running into a very simple problem. I am trying to resize an image visually within a custom table view cell (the table view cell content outlets are linked to a custom class). However, I am unable to resize either the labels or the image. Following screen shot is that of my storyboard view and the image. Any ideas if I am missing something? Thanks!
You need to put the name of your custom class on Class property of TableViewCell like the image. If it does not work, let we know more about the code.
Is this a Static Cell? If you have a UIImageView in your custom cell then you should be able to load the image and IOS will automatically size your image.
This may be a bug in my Xcode Version 5.0 (5A11365x. When I switch to Xcode 4.5.2, I am able to resize the labels. I am developing for ios 7.0. I will download the latest Xcode for ios 7 and see if that fixes the issue.
UPDATE
Yes looks like it is an Xcode bug. I just installed latest Xcode Version 5.0 (5A1412) and it allows you to adjust the label and image sizes.

Resources