Closed Ververtom closed 6 years ago
height is more than 40dp
what is "dp"?
was not rounded correctly
what do you mean? anything happens or something wrong happens?
@ealeksandrov OK, I will show my code.
EAIntroView *intro = [[EAIntroView alloc] initWithFrame:self.window.rootViewController.view.bounds andPages:@[page1,page2,page3]];
intro.pageControlY = 60.f;
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
btn.frame = CGRectMake(0, 0, 295, 66);
[btn setTitle:@"开始体验" forState:UIControlStateNormal];
[btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[btn setBackgroundColor:[UIColor colorWithTextName:@"red_500" alpha:0.7]];
btn.layer.cornerRadius = 66/2.0;
btn.layer.masksToBounds = YES;
intro.skipButton = btn;
intro.skipButtonY = 180.f;
intro.skipButtonAlignment = EAViewAlignmentCenter;
The skip button should be like round but actually it was not. It like this shape: < >.
And the height of the skip button is only 40, here is the frame and bounds showed by the debug view hierarchy.
++ 1
write it by myself
instead of fixing issue and writing PR you want to rewrite everything from scratch?
I'm not paid tech support, will look into it when I have free time after work. No deadlines ever promised.
Intro view frame laid out with auto layout and it respects its intrinsic size if no additional constraints are added. Setting button's frame is useless.
Add width and height constraints:
[intro addConstraint:[NSLayoutConstraint constraintWithItem: btn
attribute: NSLayoutAttributeWidth
relatedBy: NSLayoutRelationEqual
toItem: nil
attribute: NSLayoutAttributeNotAnAttribute
multiplier: 1.0
constant: 295]];
[intro addConstraint:[NSLayoutConstraint constraintWithItem: btn
attribute: NSLayoutAttributeHeight
relatedBy: NSLayoutRelationEqual
toItem: nil
attribute: NSLayoutAttributeNotAnAttribute
multiplier: 1.0
constant: 66]];
@ealeksandrov Thx, I just customized the Button which was based on your pods, but then you gave a better way to fix my problem, so I think what I put up should not be a problem, it supports .
When customizing the skip button, the height is more than 40dp, and I set btn.layer.cornerRadius equals 20, and masks to bouds yes, but the btn was not rounded correctly.