ios - Organising programmatically added views inside UIView with AutoLayout -


i'm trying rearrange programmatically created views inside uilabel.

numero.text = string(indexpath.row) status.text = atividade?.status nomeatividade.text = atividade?.nome  numero.sizetofit() status.sizetofit() nomeatividade.sizetofit()  cellatividade.textlabel?.addsubview(numero) cellatividade.textlabel?.addsubview(status) cellatividade.textlabel?.addsubview(nomeatividade) 

that's code creates views , add 'em uilabel.

var viewsdictionary = ["numero":numero, "status":status, "nomeatividade":nomeatividade]  let view_constraint_v:nsarray = nslayoutconstraint.constraintswithvisualformat("h:|-[numero]-[status]-[nomeatividade]", options: nslayoutformatoptions(0), metrics: nil, views: viewsdictionary)  cellatividade.textlabel?.addconstraints(view_constraint_v [anyobject]) 

and that's 1 i'm using create autolayout.

so, i'm getting autolayout errors, "unable simultaneously satisfy constraints" , can imagine happening because i'm not using vfl right.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -