diff --git a/MCEmojiPicker.podspec b/MCEmojiPicker.podspec index dea9037..683f433 100644 --- a/MCEmojiPicker.podspec +++ b/MCEmojiPicker.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MCEmojiPicker' - s.version = '1.1' + s.version = '1.1.1' s.license = 'MIT' s.summary = 'Emoji picker for iOS like on MacOS' s.homepage = 'https://github.com/izyumkin/MCEmojiPicker' diff --git a/Sources/MCEmojiPicker/View/Views/EmojiSkinTonePickerView/MCEmojiSkinTonePickerView.swift b/Sources/MCEmojiPicker/View/Views/EmojiSkinTonePickerView/MCEmojiSkinTonePickerView.swift index fa9d7a1..5f41eaa 100644 --- a/Sources/MCEmojiPicker/View/Views/EmojiSkinTonePickerView/MCEmojiSkinTonePickerView.swift +++ b/Sources/MCEmojiPicker/View/Views/EmojiSkinTonePickerView/MCEmojiSkinTonePickerView.swift @@ -173,7 +173,8 @@ final class MCEmojiSkinTonePickerView: UIView { let separatorSpacing = Constants.separatorInset * 2 + Constants.separatorWidth let itemsSpacing = Constants.stackViewSpacing * Double(MCEmojiSkinTone.allCases.count - 2) let allSpacings = separatorSpacing + itemsSpacing + Constants.horizontalAmountInset - let itemWidth = (backgroundView.contentFrame.width - allSpacings) / Double(MCEmojiSkinTone.allCases.count) + let itemWidth = round((backgroundView.contentFrame.width - allSpacings) / Double(MCEmojiSkinTone.allCases.count)) + let stackViewWidth = (Constants.stackViewSpacing * 4) + (itemWidth * Double(MCEmojiSkinTone.allCases.count)) + separatorSpacing var arrangedSubviews: [UIView] = MCEmojiSkinTone.allCases.map({ let label = UILabel() @@ -208,9 +209,9 @@ final class MCEmojiSkinTonePickerView: UIView { contentStackView.alignment = .center contentStackView.spacing = Constants.stackViewSpacing contentStackView.frame = .init( - x: Constants.horizontalAmountInset / 2, + x: (backgroundView.bounds.size.width - stackViewWidth) / 2, y: Constants.topInset, - width: backgroundView.contentFrame.width - Constants.horizontalAmountInset, + width: stackViewWidth, height: itemHeight ) contentStackView.setCustomSpacing(Constants.separatorInset, after: separatorView)