问题
I have a table view and two labels inside it. The second label(description label) has Hundreds of line. when I set font size of description label to 21 it's working. Why description label goes to dissappear when I am changing font size to 25? How to resolve it? I have also set auto resize cell height for increase size.
description label attribute inspector alse code screenshot is
image for disappear label when size is 25
label only show text when frame is under 8000 and for more text is not showing.
github link for problem
回答1:
Cell height should be dynamic.Have you given cell height dynamically.If you don't know how to give cell height dynamically use scrollview .
回答2:
You should check the following steps:
- Give the number of lines to 0 if you don't need how many lines can be there. Specific number of lines can be given only when you know the exact number of lines.
- Give the size of label to hold the content.
- Check for constraints Exceptions.
回答3:
@dineshsharma.. Lets try this one and let me know if you are still facing the problem. This is for top label.
And for lower label set this.
And in attribute inspector set lines to 0 for both labels. And please implement height for row at index and estimated height tableview delegates.
来源:https://stackoverflow.com/questions/46723070/label-disappear-when-changing-font-size-to-25-in-swift