guilhermearaujo / GUITabPagerViewController

MIT License
454 stars 69 forks source link

how to take selected index view? #18

Closed karthisiva closed 8 years ago

karthisiva commented 9 years ago

my code create view

i want to change images when i select tab..is there method for that?

karthisiva commented 9 years ago

I ended with following code: Manuallu i added every UIElements objects to the array and checked when i clicked tab. view creation:

To change selected image

}

-(void)setImg:(UIImageView )image setLbl:(UILabel )lbl { for (i=0; i<[self.titlesImage count]; i++) { UIImageView temp=[ self.titlesImage objectAtIndex:i]; UILabel selecedLbl=[self.titleslbl objectAtIndex:i]; if (image.tag==temp.tag) { image.image=[UIImage imageNamed:[self.selectedImages objectAtIndex:i]]; UIColor selectedFont=[CommonMethodClass pxColorWithHexValue:@"#A1CD46"]; lbl.textColor=selectedFont; } else { temp.image=[UIImage imageNamed:[self.images objectAtIndex:i]]; UIColor selectedFont=[CommonMethodClass pxColorWithHexValue:@"#8fa8d6"]; selecedLbl.textColor=selectedFont; } } }