Open MaxenceLeroy opened 3 years ago
When I use a table node and I revert it, the header has its characters reversed too.
import AsyncDisplayKit class ChatNode: ASDisplayNode { let chatTableNode = ASTableNode() let tableHeaderHeight = CGFloat(50) override init() { super.init() automaticallyManagesSubnodes = true chatTableNode.delegate = self chatTableNode.dataSource = self chatTableNode.inverted = true } extension ChatNode: ASTableDataSource, ASTableDelegate { func tableView(_: UITableView, heightForHeaderInSection _: Int) -> CGFloat { tableHeaderHeight } func tableView(_ tableView: UITableView, viewForHeaderInSection _: Int) -> UIView? { let headerView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.bounds.width, height: tableHeaderHeight)) let label = UILabel() label.frame = CGRect( x: 16, y: 16, width: headerView.frame.width - 16, height: headerView.bounds.height - 16 ) label.text = "Header" headerView.addSubview(label) return headerView }
As possible way to fix it you can transform headerView like this headerView.transform = CGAffineTransform(scaleX: 1.0, y: -1.0)
headerView
headerView.transform = CGAffineTransform(scaleX: 1.0, y: -1.0)
When I use a table node and I revert it, the header has its characters reversed too.