Comments (9)
Hi @acecilia, no, unfortunately the star sizes are not adjusted to the size of the cosmos view at the moment. It works the other way around, you set the size of a single star and the view adjusts its size to that. It works similar to a UILabel where you adjust the font size.
cosmosView.settings.starSize = 30
But I realize that the auto-size mode can be handy, thank you for the idea. I will think how it can be done.
from cosmos.
Actually, I am using this method, and I would be happy to share it with you:
let countStars = 5
ratingbar.starMargin = 2
ratingbar.starSize = (ratingbar.frame.width/countStars)-(ratingbar.starMargin) //star size gonna stretch with the width of the ratingbar
from cosmos.
@TPAD you can get a similar behavior by setting an aspect ratio constraint to it
from cosmos.
Hi, has this been fixed yet?
from cosmos.
Hi @TPAD, no, unfortunately, the auto-size feature has not been implemented yet.
from cosmos.
@acecilia I'd like to know how that works? Setting an aspect ratio constraint to the CosmosView doesn't make the stars grow when the View grows.
from cosmos.
+1
from cosmos.
@tiuya @siideffect sorry, just saw this. Its been a long time I stopped working with this code and I do not remember how I finally managed.
from cosmos.
This feature would be a very useful and actually necessary addition.
from cosmos.
Related Issues (20)
- Command CompileSwift failed with a nonzero exit code HOT 1
- Storyboard warning on Xcode 12.1: "Ignoring user defined runtime attribute for key path "updateOnTouch"" HOT 3
- Unwanted behavior in a UIScrollView HOT 4
- Please add macOS support in SwiftUI HOT 3
- How to disable tapping? HOT 2
- How to set empty image for empty start(non partially filled as well) HOT 6
- My image and `withTintColor` HOT 2
- How to prevent didTouchCosmos from issuing a rating
- Can you please build the framework for the Simulator HOT 3
- [Feature Request] Add custom image for half star HOT 4
- Filled color values changing even though the data is not. HOT 6
- Error While installing pod. HOT 1
- Tap gesture recognizer messes up Cosmos HOT 1
- Build failed in Storyboard
- Showing Recent Messages /Package.swift has no Package.swift manifest for version 9.0.0 in https://github.com/evgenyneu/Cosmos.git
- Single star doesn't show precise filling.
- Tapping on Rating always select 3 rating when VoiceOver is on
- Remove rating after giving
- Set custom accessibilityLabel for Cosmos View HOT 1
- demo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cosmos.