1

I am new to IOS development. I am facing an issue regarding Linebreak in end of label. I have set tableview cell label linebreak as Truncate Tail but its not working (not replacing end with three dots). Kindly guide my that how can I resolve this issue. Thank You

No three dots are showing as LineBreak

On Drag Left Label Text is overlaping the action buttons.

Saad Saeed
  • 63
  • 7
  • Welcome to stack overflow :-) Please look at [ask] and how to create a [mcve]. Please post code as text, not as image. This will help to get useful answers. – JimHawkins Oct 31 '16 at 07:58
  • what are the constraints that you are adding to the label? are you determining its width (by adding leading a trailing to it)? – Ahmad F Oct 31 '16 at 08:00
  • Make sure you auto constraints to your label first and check my answer in this post may helps http://stackoverflow.com/questions/40293336/uitableviewautomaticdimension-not-working-for-resizing-cell-height/40300589#40300589 – Joe Oct 31 '16 at 08:24
  • @Joe Thank you too Joe and Ahmad :) – Saad Saeed Oct 31 '16 at 09:10

2 Answers2

1

You have given cell.eventName.numberOfLines = 0 , this means it will wrap your text in multiple line. It will not truncate it. You need to give default numberOfLines(i.e. 1) to get the three dots at the end.

Annie Gupta
  • 2,786
  • 15
  • 23
  • Hi @Sharpkits, I have changed cell.eventName.numberOfLines to 1. but result remains same even I remove this line no effect no result. – Saad Saeed Oct 31 '16 at 08:04
  • May be width of your eventName label is going out of your screen as observed from screenshots. Layout of label is not set properly. – Annie Gupta Oct 31 '16 at 08:10
1

Please Click 'Resolve Auto Layout constraints' and then click Update Layout Constraints. It will appear popup then add height and width constraints. You will see issue will be resolved.

Zohaib Ali
  • 26
  • 3