Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Block is not displaying properly in ASDisplayNode. #3303

Open
vandana26V opened this issue Mar 12, 2018 · 0 comments
Open

Block is not displaying properly in ASDisplayNode. #3303

vandana26V opened this issue Mar 12, 2018 · 0 comments

Comments

@vandana26V
Copy link

vandana26V commented Mar 12, 2018

Hi I am using View(From xib) as a block. If I set the newCellNode.style.width = ASDimensionMake(200) Labels in the first block(Tableview Header) is not displaying.
If I have 3 blocks I want 2nd block to be displayed in center with small preview of 1st and 3rd block.

Code snippet:

var cellNodes = [ASDisplayNode]()
  for i in 0...2 {
    let newCellNode: ASCellNode = ASCellNode(viewBlock: {
      let convHeaderPrevView = ConversationWithPreviewUIView.init().instanceFromNib() as! ConversationWithPreviewTableViewCell
      
      convHeaderPrevView.firstNameLabel?.text = "XYZ"
      convHeaderPrevView.lastNameLabel?.text = "ABCD"
      convHeaderPrevView.countLabel?.text = "1234"
      
      self.headerView = convHeaderPrevView
      
      let conversationView = ConversationalView.init().instanceFromNib() as! ConversationalUITableViewCell

      let uiN: UINib = UINib(nibName: self.cellReuseIdentifier, bundle: nil)
      conversationView.conversationalTableView?.register(uiN, forCellReuseIdentifier: self.cellReuseIdentifier)

      self.documentTableView = conversationView.conversationalTableView
      self.documentTableView.dataSource = self
      self.documentTableView.delegate = self

      self.documentTableView.rowHeight = UITableViewAutomaticDimension
      self.documentTableView.estimatedRowHeight =  50
      self.documentTableView.sectionHeaderHeight = UITableViewAutomaticDimension
      self.documentTableView.estimatedSectionHeaderHeight = 20
      self.documentTableView.sectionFooterHeight = 0

      self.documentTableView.reloadData()
      
      self.msgView = conversationView
      self.msgView?.frame =  self.UITableView_Auto_Height(custmView: self.msgView!)
      conversationView.frame = (self.msgView?.frame)!

      let viewBlock = conversationView
      return viewBlock

    })
    
   newCellNode.style.width = ASDimensionMake(200)
    newCellNode.style.height = ASDimensionMake(225)
    cellNodes.append(newCellNode)
  }
  
  messengerView.addMessage(sendCollectionViewWithNodes(cellNodes, numberOfRows: 1, isIncomingMessage: true), scrollsToMessage: true)

blockwithfixedwidth
blockwithoutfixedwidth
requireduidesign

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant