ios-custom-alertview
ios-custom-alertview copied to clipboard
The alert view not showing up at all
I have used the same code. Added the delegate and imported the header file. Still Alert not showing up
-
(IBAction)contactUs:(id)sender { // Here we need to pass a full frame CustomIOS7AlertView *alertView = [[CustomIOS7AlertView alloc] init];
[alertView setContainerView:[self createDemoView]]; [alertView setBackgroundColor:[UIColor blackColor]];
[alertView setButtonTitles:[NSMutableArray arrayWithObjects:@"Close", nil]]; [alertView setDelegate:self];
[alertView setOnButtonTouchUpInside:^(CustomIOS7AlertView *alertView, int buttonIndex) { NSLog(@"Block: Button at position %d is clicked on alertView %d.", buttonIndex, [alertView tag]); [alertView close]; }];
//[alertView setUseMotionEffects:true];
// And launch the dialog [alertView show]; }
-
(void)customIOS7dialogButtonTouchUpInside: (CustomIOS7AlertView *)alertView clickedButtonAtIndex: (NSInteger)buttonIndex {
[alertView close]; }
-
(UIView *)createDemoView { UIView *demoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 290, 400)];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 300, 150)]; label.backgroundColor = [UIColor clearColor]; label.font = [UIFont fontWithName:@"helveticaNeue-Bold" size:13]; label.textColor = [UIColor grayColor]; label.numberOfLines = 12; label.lineBreakMode = NSLineBreakByWordWrapping; label.text = [NSString stringWithFormat:@"ssdmfbs shbf ,jsdhf b,shf b,shdfb ,sdfb ,sdfb ,sdjfb ,sdjfb,djksfbdjksf.skjdf.ksjdfh.ksjfdh.skjdfh.skjdfh.skjdfh"]; [demoView addSubview:label];
return demoView; }
Same Problem here...I just does´t come up!
hey @chrizstone and @sharanyakm - does the project in the repo work for you? in case it does, can you share some more of your code? are you trying to launch the alert view in viewDidLoad?
Same here. Using this code for creating AlertView:
- (IBAction)plusProjectButtonPressed:(id)sender {
CustomIOS7AlertView *newProjectAlert = [[CustomIOS7AlertView alloc] init];
[newProjectAlert setButtonTitles:[NSMutableArray arrayWithObjects:@"Cancel", @"Create", nil]];
[newProjectAlert setUseMotionEffects:TRUE];
BLNewProjectContainedView *newProject = [[BLNewProjectContainedView alloc] init];
[newProjectAlert setContainerView:newProject];
[newProjectAlert show];
};
BLNewProjectContainedView is inherited from UIView and contains only one UITextField And almost nothing happens, just a little more dark screen, but without Alert.
I've found that if I use the sample project and fire on the launchDialog button everything looks great. However, I'm trying to fire on a condition. If I remove the launchDialog and add this code (with proper initialization) if(!didRunBefore) { NSLog(@"Should see alert view"); //Note : This works [self launchDialog]; } I don't see the alert view. I changed the launchDialog to -(void)launchDialog. Very mysterious.