Cosmos icon indicating copy to clipboard operation
Cosmos copied to clipboard

Star Size In tableView Cell

Open applepeopletsai opened this issue 6 years ago • 10 comments

Hi, thanks the library first! It's Great! But I have some issue to user Cosmos View in TableView Cell The star size is not fit the view size like this: image Am I miss something?

applepeopletsai avatar Mar 28 '18 01:03 applepeopletsai

Thanks for reporting. How do you position the Cosmos view in your cell? Do you limit its width and height?

evgenyneu avatar Mar 28 '18 04:03 evgenyneu

Thanks for reply quickly.

Yes, I have limit its like this: image

and I build for iOS 11 on iPhone 5s: image

Debug View Hierarchy like this: image

Is there something wrong?

applepeopletsai avatar Mar 28 '18 05:03 applepeopletsai

Thanks for explaining your layout. Yes, this won't work, unfortunately. The size of cosmos view is determined automatically by the size of the stars and separation between them. It's like UILabel. In your layout the width of the cosmos view is limited by the leading and trailing constraints. It can't fit the stars inside this width. I would suggest using just one constraint (leading or trailing) and let cosmos view grow to the size it needs. Same applies to height. Let me know if it helps. :)

evgenyneu avatar Mar 28 '18 05:03 evgenyneu

Oh, I understand! But for generally, developer usually give the view size in storyboard, and expect the star size would fit the view size automatically I think. In a word, thanks very much for your help. :)

applepeopletsai avatar Mar 28 '18 06:03 applepeopletsai

But for generally, developer usually give the view size in storyboard, and expect the star size would fit the view size automatically I think.

Yes, that would be nice to implement, totally agree.

evgenyneu avatar Mar 28 '18 06:03 evgenyneu

Thanks for your reply, if you agree with that, maybe we can implement in this way. Let me know what you think, thank you. :)

applepeopletsai avatar Mar 28 '18 10:03 applepeopletsai

I'm currently in the middle of the semester in uni and don't have time to develop new features. Pull requests are always welcome :).

evgenyneu avatar Mar 28 '18 10:03 evgenyneu

Ok, Good luck! And I don't think I am entitled to pull request because I am just a beginner. So, we can do that after end of the semester. :)

applepeopletsai avatar Mar 28 '18 11:03 applepeopletsai

And I don't think I am entitled to pull request because I am just a beginner.

I'm a beginner as well.

So, we can do that after end of the semester. :)

Yeah, I hope so, but I would not put my money on it.

evgenyneu avatar Mar 28 '18 19:03 evgenyneu

hi

But It is possible you can change size in storyboard as small as you want ,default is 20. Library is awesome, but i need how to centre that starts in broader frame .

antonyios avatar Mar 29 '18 07:03 antonyios