uiview - Objective C - How to create a set of sub views to update -
perhaps thinking incorrectly, please point me in right direction..
i want make many uiviews property can update them different methods. this:
@property uiview *view1 @property uiview *view2 ... @property uiview *view200 -(void)updateviews{ (i=0; <200; i++){ //update view here }
so questions are:
- how can make multiple views?
- how can pass message each individual view?
so many great responses, think need add little more info.
have tried putting uiviews array index them struggle access them update positions within uiviewcontroller. thought making them property correct way since need update them device heading. looks using tag might best. can further comment on approach:
for (i = 0 ; < 144; i++) { uiview *sunview =[[uiimageview alloc] initwithimage:[uiimage imagenamed:@"sun.png"]]; sunview.tag = i; } //then later, in separate method following: (i = 0 ; < 144; i++) { cgfloat cgx = self.acceleration.x; cgfloat cgy = self.acceleration.y [sunview.tag.i setframe:cgrectmake(cgx, cgy, 20, 20)] }
im not sure how access uview corresponding indexed tag. can me there too?
when subviews iterate through superview's subviews array.
you recursievely in order apply on subivews of subviews, if have multiple hierarchy levels.
if don't want apply each of superview's subviews, tag subviews view.tag = 6502
, use identify views want apply it.
or maintain own array or set (iterable collection) of views , iterate through them.
Comments
Post a Comment