Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set image instead of label at tap? #1

Open
karthisiva opened this issue Jul 15, 2015 · 0 comments
Open

set image instead of label at tap? #1

karthisiva opened this issue Jul 15, 2015 · 0 comments

Comments

@karthisiva
Copy link

how to set image instead of label,i tried this but not working.

  • (UIView *)viewPager:(ViewPagerController *)viewPager viewForTabAtIndex:(NSUInteger)index
    {
    // UILabel *label = [UILabel new];
    // label.backgroundColor = [UIColor clearColor];
    // label.font = [UIFont systemFontOfSize:12.0];
    // label.text = [NSString stringWithFormat:@"karthi #%lu", (unsigned long)index];
    // label.textAlignment = NSTextAlignmentCenter;
    // label.textColor = [UIColor blackColor];
    // [label sizeToFit];
    UIImageView *img=[UIImageView new];
    img.frame=CGRectMake(0, 0, 22, 22);
    [img sizeToFit];
    img.image=[UIImage imageNamed:[self.images objectAtIndex:index]];
    [self.titlesLabels insertObject:img atIndex:index];

    return img;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant