I have a UITableView that has cells that are defined in XIBs. I am calling showSkeletonView on the table view, but all I see is the grey background of the cells.

If I inspect the view with Xcode, I can see that the other views are there (and appear to be on top but I can't see them in simulator?), but they are not skeletons.

My hierarchy for the table goes like this:
View Controller
+--View (Skeletonable: Default)
+--Table View (Skeletonable: Yes)
+-- Cell
And for the cell:
Cell
+--Cell Container (Skeletonable: Yes)
+--Empty View (Skeletonable: No)
+--View (Skeletonable: Yes)
+--Stack View (Skeletonable: No)
+--Stack View (Skeletonable: No)
| +--Label (Skeletonable: Yes)
| +--Label (Skeletonable: Yes)
+--Image View (Skeletonable: Yes)
I have tried setting everything to skeletonable without any luck. Hopefully these hierarchies make sense...
I don't want my cells to set that grey background, It should be white. The labels and the image view should be skeletons. I don't want the grey (hopefully white) cell background to obscure the skeleton views.
The table is white, the cell containers are grey, the cell subviews do not get skeletoned, even though the cells appear to be on top I can't see them, just the grey block.
SkeletonView version: 1.4
Xcode version: 9.4.1
Swift version: 4.1
Hey @Fawxy , to work as expected, your whole view hierarchy must have the isSkeletonable property set to true.
As I said I tried changing everything to skeletonable - if I understand it it's everything from the top down needs to be skeletonable? So, if I do this:
View Controller
+--View (Skeletonable: Default)
+--Table View (Skeletonable: Yes)
+-- Cell
Cell
+--Cell Container (Skeletonable: Yes)
+--Empty View (Skeletonable: Yes)
+--View (Skeletonable: Yes)
+--Stack View (Skeletonable: Yes)
+--Stack View (Skeletonable: Yes)
| +--Label (Skeletonable: Yes)
| +--Label (Skeletonable: Yes)
+--Image View (Skeletonable: Yes)
I get the same result.
Hey @Fawxy ,
What about the Cell ? It should also be skeletonable.
Maybe by enabling the new debug mode it will be easier for you to identify the issue ?
@Fawxy hey, are you calling showSkeletonView() on viewDidAppear?
@Skornos actually on viewWillAppear
Hi @Fawxy, as @arn00s said, could you active debug mode in order to see which hierarchy is using SkeletonView?
猬団瑖 鈽狅笍 Root view hierarchy with Skeletons 猬団瑖
<UITableView: 0x00007fc9d701de00 | (3) subSkeletons | 鈽狅笍 >
<ArticleContentView: 0x00007fc9d9832600 | 鈽狅笍 >
<ArticleContentView: 0x00007fc9d9864a00 | 鈽狅笍 >
<ArticleContentView: 0x00007fc9da015e00 | 鈽狅笍 >
I get this result. Why wouldn't the subviews inside ArticleContentView be showing? They are set to skeletonable...
Do I need to call showSkeleton on the article content view too? I'm calling showSkeleton on the table view in viewDidAppear
SkeletonView doesn鈥檛 find skeletonables views inside ArticleContentView view. Maybe you have a view not skeletonable between ArticleContentView and those subviews? Could you give me some code of your project to try to find what is it happening?
Sent with GitHawk
Demo project here: https://github.com/Fawxy/SkeletonViewTest. It could be because when converting XIB to cell it adds an extra view in?
Ok I figured this out. My XIB contained a view, so when I converted it to a tableviewcell it embedded that view into the cell. I changed the xib so it contained a cell, made the views skeletonable and it all worked as expected. Thanks for your replies!
Great! thanks for use SkeletonView
Most helpful comment
Ok I figured this out. My XIB contained a view, so when I converted it to a tableviewcell it embedded that view into the cell. I changed the xib so it contained a cell, made the views skeletonable and it all worked as expected. Thanks for your replies!