Using the class I could set the bottom inset to solve the issue with the font clipping. ![]() I'd already created a UILabel subclass that allowed me to add content insets (but for the purpose of setting tableHeaderView straight to a label without having to contain it in another view). I ran into this too, but wanted to avoid adding a height constraint. You could read more here about UILabel's baselineAdjustmenton official documentation. Since bonding box origin matches the label's frame, it should fix any problem for a one-lined label with AutoShrink enabled. none case said:Īdjust text relative to the top-left corner of the bounding box. So the best approach is to set label.baselineAdjustment =. Just center text on the bigger bounding box could still clip it. alignCenters solve some problems but not others. Understanding this behaviour is crucial to explain why set. If I look at it in Web Layout or in Outline Mode, the text displays correctly. If I print it the text displays correctly. Then put the column horizontal alignment to center. If I turn on the paragraph and hidden character symbols, the text displays correctly. You can go to advanced tab on Icon and make the icon have a custom position of inline-block. When I look at the bottom of the page in Print Layout, the text looks like it is cut off. alignBaselines, text aligns to the cropped bottom and we could observe line clipping. The document has tables nested within tables. That said, with baselineAdjustment property set to it's default state. minimumFontSize.Īs a consequence, the bounding box grows bigger than the line height and the visible portion of UILabel's height. It looks like the bounding box grows in height when we shrink the text through AutoShrink. What we observe here in our case is some version of this bug. The document has tables nested within tables. There is some discussions like this one about a bug on UILabel's text bounding box. Text getting cut off and not showing in Print View, but will print correctly and show when Paragraph Marks/hidden format symbols are showing I have a document that is being exported from a browser based database to Word. This property could be found under UILabel's Attributes inspector with the name "Baseline". ![]() noneĪlso it could be changed through interface builder. It is needed because of an old UILabel's known bug. Probably the property you are looking for is UILabel's baselineAdjustment.
0 Comments
Leave a Reply. |