IPhone adding components to UiScrollView running

I’m new to objective C, I have a view based application which communicates with a web service and recives an xml, parse it and map its contens an appropriate view component (e.g if thats a date show the question with datepicker, if question has 2 values show it with a segmented control, if more with a pickerview..etc) so its a dynamic questionary with many pages filled with multiple components.

how can I do the design for the mapping the xml response into related UI view components on runtime? I want to make the code as object orient as possible and not too many if elses in my view controller class, but instead it should only receive a let’s say “uiview object” filled with necessary view components and it will just show it. I have a UiScrollView and want to add new different approprite Uicomponents(Picker, textbox, label..) to it on real time, How can I do this? I think in the Interface builder I only need to put the scrollview and the rest will be in code? and using a scrollview a good choice here? thanks.

[self.view addSubView: imageview];
[self.scrollView addsubview:pickerview];
[self.view addSubView:scrollview];

like wise the custom view may be like uibutton,textfield,textview,imageview

Hello, buddy!责编内容来自:Hello, buddy! (源链) | 更多关于

阅读提示:酷辣虫无法对本内容的真实性提供任何保证,请自行验证并承担相关的风险与后果!
本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 移动开发 » IPhone adding components to UiScrollView running

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录