Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added size option for EKRatingSymbolsContainerView #266

Merged
merged 3 commits into from
Aug 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ final public class EKRatingSymbolsContainerView: UIView {
selection: internalSelection)
itemView.tag = index
addSubview(itemView)
itemView.set(.width, .height, of: 50)
itemView.set(.height, of: item.size.height)
itemView.set(.width, of: item.size.width)
symbolsArray.append(itemView)
}
symbolsArray.layoutToSuperview(axis: .vertically, priority: .must)
symbolsArray.spread(.horizontally, stretchEdgesToSuperview: true)

select()
select(index: message.selectedIndex)
}

private func select(index: Int? = nil) {
Expand Down
7 changes: 5 additions & 2 deletions Source/Model/EKProperty.swift
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,18 @@ public struct EKProperty {
public var description: EKProperty.LabelContent
public var unselectedImage: EKProperty.ImageContent
public var selectedImage: EKProperty.ImageContent

public var size: CGSize

public init(title: EKProperty.LabelContent,
description: EKProperty.LabelContent,
unselectedImage: EKProperty.ImageContent,
selectedImage: EKProperty.ImageContent) {
selectedImage: EKProperty.ImageContent,
size: CGSize = CGSize(width: 50, height: 50)) {
self.title = title
self.description = description
self.unselectedImage = unselectedImage
self.selectedImage = selectedImage
self.size = size
}
}
}