Where can I get system size of UI elements in iOS?
For example,
- UIButton corner radius,
- UIWindow size (I know it’s 320pt, but is there a constant for it?),
- System font size,
- Navigation bar height,
- Tab bar height,
- Status bar height, etc.
Do they have predefined constants or similar?
I don’t think there’s an API for that.
You could get this via
[[UIScreen mainScreen] bounds].UIFonthas class methods for getting standard font sizes:labelFontSize,buttonFontSize,smallSystemFontSizeandsystemFontSizeare available.The
UIViewinstance methodsizeThatFits:could be used to get the default sizes for those.You can get this implicitly by subtracting the height of
[[UIScreen mainScreen] bounds]from[[UIScreen mainScreen] applicationFrame].