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

How to dynamically add content to a view and style it(autolayout)? #681

Open
Varek opened this issue Apr 29, 2015 · 3 comments
Open

How to dynamically add content to a view and style it(autolayout)? #681

Varek opened this issue Apr 29, 2015 · 3 comments
Labels

Comments

@Varek
Copy link

Varek commented Apr 29, 2015

Hi, I just started working with RubyMotion and was working in the last days through a lot of examples and tutorials to get familiar with writing iOS apps with ruby. But now I'm stuck at quite simple thing from web developer perspective and I was also not able to find examples to explain how to handle it.
I have a list of courses and each course can have multiple instructors which I retrieve by an API. Now I want to show a course and display all the instructors with image and name there.
What is the best way to achieve this?
Do I build a view for one instructor and add it then multiple times?
Or a Layout, considering that I also use motion-kit, but do I add this as a subview to my view?
And how do I make auto-layout between the instructor elements work?
I'm sorry if it overlaps too much with motion-kit, but I'm confused how to achieve this fairly easy thing with using both ProMotion and motion-kit and I'm not sure where it really belongs to. Also a link to a guide or example I may have over looked, would be helpful.

Thanks so far.

@jamonholmgren
Copy link
Owner

Hi @Varek ! Welcome to RubyMotion. :)

Perhaps something like this would help?

http://jamonholmgren.com/getting-started-with-motionkit-and-promotion/

@Varek
Copy link
Author

Varek commented Apr 30, 2015

Not really. I don't want to display the information in a table. Like I would take movie posters and would put them into a row in your example.

@jamonholmgren
Copy link
Owner

Okay, gotcha. You're probably looking for a CollectionView. I have a "CollectionScreen" halfway implemented on a branch here, but it's not done. Hoping to get a chance to do that in the next few months, but no timetable yet. In the meantime, look at UICollectionViewController documentation and see where that gets you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants