Skip to content

Issue with Card View Not Showing #4

@winniepooh001

Description

@winniepooh001

Hi,

Thank you for sharing the card view it looks very good. I'm having trouble to get the example working (I'm using Materials as well) card view is not showing. I did try to isolate and see if it is related to the cell, but if i just show the cell they will show in view. I'm doing it without storyboard. I'm not sure if i would be the cause of the problem. Only the first few lines of the code from example I changed just so that I can figure out why its not showing. However, I still couldn't figure out. It looks like objects were initiated under the card view, but the card view is not showing.

var card = CardView(frame: CGRect(x: 100, y: 200, width: 500, height: 500))

open override func viewDidLoad() {
    
    super.viewDidLoad()
    
    self.card.frame  = CGRect(x: 100, y: 200, width: 500, height: 500)
    self.card.backgroundColor = UIColor.red
    
    view.addSubview(self.card)
     self.card.cardDataSource = self
    self.card.registerCardCell(c: CardACell.classForCoder(), nib: UINib.init(nibName: "CardACell", bundle: Bundle.main))
   
    prepareToolbar()
    let arr = self.generateCardInfo(cardCount: 10)
    self.card.set(cards: arr)
    
    

    self.card.showStyle(style: .cover)
    //view.layout(card).horizontally().center()
    
    view.backgroundColor = UIColor.purple
    
   
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions