Borders
Last updated
Last updated
We can add an inner border to objects with:
Which results in (Label 1 and Label 2):
Since it's an inner and not an outer border, doing it by code is mostly a waste of processing power, as it would make no difference to the asset to have an inner border drawn into it. However, it can be a good idea if:
The object can have multiple border colors (so we would only need one asset instead of multiple ones)
The object can be done 100% by code, so we wouldn't need assets at all (like the labels on the picture)
There is no simple way to do an outer border in iOS. We can only do it via ugly workarounds, like expanding the object and treating the outer border as an inner border.
It's probably not a problem, but it really depends on what you want to achieve.
Round borders in particular can have a performance impact. If it's just a single or even a couple round bordered elements on screen, it's probably fine and no impact will be noticed, but there may be performance issues when round borders are used in a list (table view), for example. If each cell displays a round bordered element, the frames per second when scrolling the list may be affected and it's possible that it won't be 60 FPS (the ideal for a smooth experience), especially when other heavy elements are used (such as shadows).