UIPicker: Difference between revisions

From Medien Wiki
Line 61: Line 61:
/* Method sets the background views for the pickers
/* Method sets the background views for the pickers
   
   
bgViews an array of background views for the pickers
bgViews an array of background views for the pickers
YOU should have for every Picker one background view
*/
-(void) setBackgroundViews: (NSArray*) bgViews;
 
/* Method sets the selected background views for the pickers
bgViews an array of selected background views for the pickers
   
   
YOU should have for every Picker one background view
YOU should have for every Picker one background view
Line 152: Line 160:


/* Method sets the background views for the pickers
/* Method sets the background views for the pickers
bgViews an array of background views for the pickers
YOU should have for every Picker one background view
*/
-(void) setBackgroundViews: (NSArray*) bgViews{
//If bgViews count is not equal to the picker view count
if ([bgViews count] !=[self.titleArray count]) {
return;
}
for (int i=0; i<[self.titleArray count]; i++) {
UIView* newView=[bgViews objectAtIndex:i];
if (!newView) {
return;
}
int index=10004+i*10;
UIView* v=[self.baseView viewWithTag:index];
newView.frame=v.frame;
[v.superview insertSubview:newView belowSubview:v];
[v removeFromSuperview];
}
}
/* Method sets the selected background views for the pickers
bgViews an array of background views for the pickers
bgViews an array of selected background views for the pickers
YOU should have for every Picker one background view
YOU should have for every Picker one selected background view
  */
  */
-(void) setSelectedBackgroundViews: (NSArray*) bgViews{
-(void) setSelectedBackgroundViews: (NSArray*) bgViews{