calimarkus / JDFlipNumberView

[iOS] Animated analog flip numbers like airport/train-station displays (Swift/SwiftUI ready)
MIT License
786 stars 138 forks source link

Allow JDFlipViewRelativeMargin to be configured #37

Closed cyrilchandelier closed 9 years ago

cyrilchandelier commented 10 years ago

This value should be configurable someplace in the component to enhance the rendering.

For instance with my custom design, the views are too close one from each other, I would like to set JDFlipViewRelativeMargin to something like 30%.

johnboiles commented 9 years ago

:+1: agree. I might give this a shot.

Another way to think about it could be to add two values that work in points instead of percentages:

//! Outer padding in points
@property UIEdgeInsets insets;
//! Spacing between numbers in points
@property CGFloat numberMargin;

What do you think about that instead of doing a percentage margin?

calimarkus commented 9 years ago

We can make two properties:

@property CGFloat relativeDigitMargin; @property CGFloat absoluteDigitMargin;

and then just use MAX(relative*width, absolute) as margin. Pull requests welcome.

johnboiles commented 9 years ago

Here you go! #42