Closed tunidev closed 10 years ago
UIView
with your own buttons, attached to actions, and pass it to titleView
property of EAIntroView. This way your custom view will float above all scrollable content. If you want separate buttons on each page - pass them inside custom views in pageWithCustomView:
.swipeToExit
property to NO
. And if you are adding all buttons in your custom view - pass nil
to skipButton
.Hello,
Thank you for your fast replay, I tried your solution and it solves the second problem, but in the first one the buttons are added in the top of the page, and from the user experience perspective, it's more intuitive to have the buttons in the bottom of the page, just like the screen shot that I have attached in my first post here is the code that I have tried with the screenshot of the result :
EAIntroView *intro = [[EAIntroView alloc] initWithFrame:self.view.bounds andPages:@[page1,page2]];
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Sign up" forState:UIControlStateNormal];
button.frame = CGRectMake(80.0, 210.0, 160.0, 40.0);
button.backgroundColor = [UIColor blackColor];
intro.swipeToExit = NO ;
intro.skipButton = nil ;
intro.titleView = button;
EAIntroView *intro = [[EAIntroView alloc] initWithFrame:self.view.bounds andPages:@[page1,page2]];
UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(0,0, 300, 40.0)];
myView.userInteractionEnabled = YES ;
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Sign up" forState:UIControlStateNormal];
button.frame = CGRectMake(20.0, 440.0, 100.0, 40.0);
button.backgroundColor = [UIColor whiteColor];
UIButton *button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button2 addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[button2 setTitle:@"Login" forState:UIControlStateNormal];
button2.frame = CGRectMake(160, 440.0, 100.0, 40.0);
button2.backgroundColor = [UIColor lightGrayColor];
[myView addSubview:button];
[myView addSubview:button2];
intro.swipeToExit = NO ;
intro.skipButton = nil ;
intro.titleView = myView;
Hello,
I ended up with playing with "intro.titleViewY" and "pageControlY" to reach this result
here is the code
EAIntroView *intro = [[EAIntroView alloc] initWithFrame:self.view.bounds andPages:@[page1,page2]];
UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(0,0, 300, 40.0)];
myView.userInteractionEnabled = YES ;
UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[button setTitle:@"Sign up" forState:UIControlStateNormal];
button.frame = CGRectMake(20.0, 0, 100.0, 40.0);
button.backgroundColor = [UIColor whiteColor];
UIButton *button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button2 addTarget:self
action:@selector(aMethod:)
forControlEvents:UIControlEventTouchDown];
[button2 setTitle:@"Login" forState:UIControlStateNormal];
button2.frame = CGRectMake(180, 0, 100.0, 40.0);
button2.backgroundColor = [UIColor lightGrayColor];
[myView addSubview:button];
[myView addSubview:button2];
intro.swipeToExit = NO ;
intro.skipButton = nil ;
intro.titleView = myView;
intro.titleViewY = 480. ;
intro.pageControlY = 200. ;
But now I figure out that the buttons are not visible in the 3.5" screen size, any solution ?
EDIT : I solved that by changing the line
intro.titleViewY = 480. ;
to
intro.titleViewY = [UIScreen mainScreen].bounds.size.height - 60;
Yes, UIView
as a container for your custom buttons is the solution. Hope you have reached the desired layout.
Hello,
1/ I want to add buttons in all pages, the same buttons just like Wunderlist app you can see it in action in this screen shot
after adding them how can I handle their actions, in other word, if the user is viewing for example the second page and then he clicked on the "sign up" button how to handle that
2/ I want to avoid the "Intro callback", I just want to implement for example 4 pages, when the user reach the last page he is stack there he only can back to previous views or click the buttons implemented in "1/"