mirror of
https://github.com/material-components/material-components-ios.git
synced 2026-02-20 08:27:32 +08:00
<h4> ```diff - Warning - This may break screenshot testing - ``` </h4> ### Context Currently the badge is centered on the top of the `iconImageView`. The `iconImageView`'s `origin.y` is at 8.883 in MDC because we vertically center the _content_ in the MDCBottomNavigationItemView. We get the _content_ height by: _contentHeight_ = icon.height + label.height + contentVerticalMargin _contentVerticalMargin_ is the spacing between the icon and label. The **_badge_** is 14dp tall. Centering the badge on the `iconImageView`'s `origin.y` puts the badge at 1.883. ### The problem The badge is too high in relation to the top of the bottom navigation bar and doesn't match internal guidance. ### The fix Make the badge and iconImageView have the same origin y, giving users more separation between the top of the navigation bar and the top of the badge. ### Related PR Closes #4731 ### Screenshots | Before | After | | - | - | |||