Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SF Symbol looks distorted

When using the new SF Symbols on a UIButton, the symbols seems to be distorted on my iPhone 8, while on an iPhone 11 Simulator everythings fine. On the iPhone 8 the symbols seems to squished horizontally making it too tall. I made a gif to illustrate the problem. The gif shows two screenshots transitioning. One from the 8 and one from the 11:

Illustration of the problem

Does anyone else have this problem? What is going on here?

Edit:

IB Attributes. The Button is constrained to all for edges of the containing view.

Edit #2: The Symbol is sized properly when specifying a Font for the symbol and scale "Large". I tried SystemFont "Headline".

IB Attributes

like image 829
Josh Avatar asked Mar 03 '23 07:03

Josh


1 Answers

Setting the content mode on the button's image view in code seems to work as a work around.

button.imageView?.contentMode = .scaleAspectFit

The info circle in the screenshot below is a UIButton using the 'info.circle.fill' SF Symbol.

App Example

like image 88
fahlout Avatar answered Mar 16 '23 20:03

fahlout