Thursday, 15 April 2010

ios - Auto Layout questions for UILabel sizing (project attached) -



ios - Auto Layout questions for UILabel sizing (project attached) -

i'm bit stumped regarding few things trying setup using auto layout.

here's have. can see, trying implement similar messages.app. made test/demo project similar explain bit easier.

here's project: https://github.com/runmad/messagingapp

i trying accomplish few things:

• use auto layout self-sizing cells: have set no problem, since pretty much comes free.

• add inset between label's frame , text: under possible using layoutmargins (http://carpeaqua.com/2014/07/24/auto-layout-in-ios-8-layout-margins/) have no been able this.

• size label text or 60% maximum width of contentview: have been able gray messages above (except maybe not first gray one?), have not been able right size bluish ("sent") messages maximum of 60% of width of cell's contentview.

i targeting ios 8.0, layoutmargins, should ok. using storyboard , auto layout within ib.

any help , insight much appreciated!

the problem constraints (for bluish label) can't utilize multiplier leading (or left or top) constraint. value of leading or top 0, multiplying doesn't anywhere. need create constraint between trailing border of cell (like grayness label), , leading border of label. since you're measuring other side, want have multiplier of 0.4 rather 0.6.

ios uilabel autolayout xcode-storyboard

No comments:

Post a Comment