鈿狅笍 Please fill out this template when filing an issue.
I tried to show skeleton UI in a table view of a subclass of UITableViewController class.
I expected 3 cells to show up with loading state of the image and label on each cell
The table view shows it's own loading UI, animated light gray background, no cell shows up.
class Cell: UITableViewCell {
private let titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.preferredFont(forTextStyle: .headline)
label.isSkeletonable = true
return label
}()
private let myImageView: UIImageView = {
let imageView = UIImageView()
imageView.isSkeletonable = true
imageView.contentMode = .scaleAspectFit
return imageView
}()
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
isSkeletonable = true
accessoryType = .disclosureIndicator
contentView.isSkeletonable = true
contentView.addSubview(titleLabel)
contentView.addSubview(myImageView)
NSLayoutConstraint.activate([
...
])
}
}
class ViewController: UITableViewController {
var items = [Item]()
override func viewDidLoad() {
super.viewDidLoad()
tableView.isSkeletonable = true
tableView.register(Cell.self, forCellReuseIdentifier: "Cell")
tableView.showAnimatedSkeleton()
}
}
extension ViewController: SkeletonTableViewDataSource {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: ServiceTableCell.reuseIdentifier, for: indexPath) as! Cell
return cell
}
func numberOfSections(in tableView: UITableView) -> Int {
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
func collectionSkeletonView(_ skeletonView: UITableView, cellIdentifierForRowAt indexPath: IndexPath) -> ReusableCellIdentifier {
return "Cell"
}
func collectionSkeletonView(_ skeletonView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 3
}
}
*SkeletonView version:1.4*
*Xcode version:9.4.1*
*Swift version:4.1*
I created a subclass of UIViewController, created a UITableView, added it to my view and make it fill it's bounds. That works as expected except the labels in each cell doesn't show up when the text content is empty.
I also have the same issue subclassing UICollectionViewController; the same solution of adding a collection view to a UIViewController subclass worked as well.
Same here
Same here :/
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
same here
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
How could this issue be closed - it's a serious bug - if not being solved in the near future, it should at least be mentioned in the documentation?
Hopefully it gets reopened. I have the same issue here!
Same here still.
Hi, could you check this comment, maybe it could fix our problem.
Let me know, thanks
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.