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

基本上十个便签就会出现问题了 #48

Open
GarthGit opened this issue Dec 20, 2018 · 4 comments
Open

基本上十个便签就会出现问题了 #48

GarthGit opened this issue Dec 20, 2018 · 4 comments

Comments

@GarthGit
Copy link

第十个标签滑动不出来

@GarthGit
Copy link
Author

item的间隔独立出来了吗

@GarthGit
Copy link
Author

`#pragma mark ============== item width

  • (void)layoutTabbar{

    float width = self.bounds.size.width/self.tabbarItems.count;
    float height = self.bounds.size.height;
    float x = 0.0f;
    for (NSInteger i=0; i<self.tabbarItems.count; i++) {
    x = i*width;
    UILabel *label = (UILabel *)[scrollView_ viewWithTag:kLabelTagBase+i];
    UIImageView *imageView = (UIImageView *)[scrollView_ viewWithTag:kImageTagBase+i];
    UIImageView *selectedIamgeView = (UIImageView *)[scrollView_ viewWithTag:kSelectedImageTagBase+i];
    label.frame = CGRectMake(x + (width-label.bounds.size.width-CGRectGetWidth(imageView.bounds))/2.0f, (height-label.bounds.size.height)/2.0f, CGRectGetWidth(label.bounds), CGRectGetHeight(label.bounds));
    imageView.frame = CGRectMake(label.frame.origin.x + label.bounds.size.width+kImageSpacingX, (height-imageView.bounds.size.height)/2.0, CGRectGetWidth(imageView.bounds), CGRectGetHeight(imageView.bounds));
    selectedIamgeView.frame = imageView.frame;
    }

    float trackX = width*self.selectedIndex;
    trackView_.frame = CGRectMake(trackX, trackView_.frame.origin.y, width, kTrackViewHeight);
    }
    `
    应该是这段code布局item.width?

@GarthGit
Copy link
Author

更差了

@agdsdl
Copy link
Owner

agdsdl commented Dec 26, 2018

item width有配置项的,用1.0版吧

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

2 participants