mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Fix using UIActivityIndicatorView provided in view block (#2522)
This commit is contained in:
committed by
GitHub
parent
8e6f842b8d
commit
58e9c807b9
@@ -40,8 +40,6 @@ final class TailLoadingCellNode: ASCellNode {
|
||||
|
||||
override func layoutSpecThatFits(constrainedSize: ASSizeRange) -> ASLayoutSpec {
|
||||
|
||||
spinner.style.flexBasis = ASDimensionMakeWithPoints(0.0)
|
||||
|
||||
return ASStackLayoutSpec(
|
||||
direction: .Horizontal,
|
||||
spacing: 16,
|
||||
@@ -59,12 +57,13 @@ final class SpinnerNode: ASDisplayNode {
|
||||
override init() {
|
||||
super.init(viewBlock: { UIActivityIndicatorView(activityIndicatorStyle: .Gray) }, didLoadBlock: nil)
|
||||
|
||||
|
||||
self.style.height = ASDimensionMakeWithPoints(44.0)
|
||||
// Set spinner node to default size of the activitiy indicator view
|
||||
self.style.preferredSize = CGSizeMake(20.0, 20.0)
|
||||
}
|
||||
|
||||
override func didLoad() {
|
||||
super.didLoad()
|
||||
|
||||
activityIndicatorView.startAnimating()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,9 @@ final class ViewController: ASViewController, ASTableDataSource, ASTableDelegate
|
||||
let rowCount = self.tableNode(tableNode, numberOfRowsInSection: 0)
|
||||
|
||||
if state.fetchingMore && indexPath.row == rowCount - 1 {
|
||||
return TailLoadingCellNode()
|
||||
let node = TailLoadingCellNode()
|
||||
node.style.height = ASDimensionMake(44.0)
|
||||
return node;
|
||||
}
|
||||
|
||||
let node = ASTextCellNode()
|
||||
|
||||
Reference in New Issue
Block a user