swift3 - Embedding StackView to MaterialSwift Card Content -


i attempting use cardtableview, , able render cards api call. however, trying load multiple uilabels , lay them out using uistackviews within content area of card. toolbar , bottom bar have icons , used appropriately. when embed stackview , dont set translatesautoresizingmaskintoconstraints = false cards spaced correctly, shown in picture: correct spacing of cards, no stack views rendering

however there none of labels visible. following picture shows when set translatesautoresizingmaskintoconstraints = false labels show up, card spacing ruined. stack views render, spacing off

here method preparing content:

private func preparecardcontent() {     contentlabelstackview = uistackview()     contentlabelstackview.axis = uilayoutconstraintaxis.vertical     contentlabelstackview.distribution = uistackviewdistribution.equalspacing     contentlabelstackview.alignment = uistackviewalignment.leading     contentlabelstackview.spacing = 0     contentlabelstackview.addarrangedsubview(invitedlabel)     contentlabelstackview.addarrangedsubview(teeuptitle)      contentlabelstackview.translatesautoresizingmaskintoconstraints = false } 

and code preparing card itself:

private func preparepresentercard() {     card.toolbar = toolbar     card.contentview = contentlabelstackview     card.contentviewedgeinsetspreset = .vertically5     card.bottombar = bottombar     card.depthpreset = .depth3     contentview.addsubview(card) } 

i unsure conflicting spacing , layout of cards using nested stackview.

set height value uistackview :)


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -