Generating/positioning items within UIScrollView (iPhone Dev)
Hey, I've got a UIScrollView within my main view in the appl开发者_Python百科ication, and I'm wondering what's the best way to place a set of labels and buttons within it. When I started, there was only a few, so I could physically place them in the interface builder, but now I've got more items to add to the ScrollView and can't fit them all on the screen in the interface builder. Is there a way to generate a sequence of buttons and labels? I just need them in an organized list, but I don't know how to generate content within the scrollview without specifically placing them in the IB, and then give them specific positions.
Alright well what I ended up doing was using the interface builder with the objects visible on screen (Labels, buttons) and coding them as you would when you use the interface builder (i.e. UILabel *label; in the header etc.) and then using the properties in interface builder, set their x/y position, which would move them off the screen, but since they're coded within my scrollview, they take up their spot in the scrollview, and can be scrolled down to.
精彩评论