I want to create a custom popup and I want to generate a code dynamically without using UI drag and drop.
The view should look like:
I am using the following code to call the popup :
CustomPopUp *cp = [[CustomPopUp alloc]init];
cp.view.frame = CGRectMake(0.0, 0.0, 300, 300);
KLCPopup* popup = [KLCPopup popupWithContentView:cp.view];
[popup show];
The custom popup code looks like:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.gaScreenName = @"Login";
if (firstPageLoad) {
return;
}
LinearLayoutPageHeading *heading = [[LinearLayoutPageHeading alloc] initWithText:@"Sign in." maxWidth:[LayoutValues getMaxWidthClipped]];
[self.topContainerContent addObject:heading];
NSString *content = @"New patient? Register here.";
LinearLayoutLinksViewItem *contentItem = [[LinearLayoutLinksViewItem alloc] initLinksViewWithText:content font:[PPFonts genericParagraphFont] maxWidth:[LayoutValues getMaxWidthClipped] links:nil];
[self.topContainerContent addObject:contentItem];
LinearLayoutTextInputAndLabel *emailField = [[LinearLayoutTextInputAndLabel alloc] initWithLabelText:@"EMAIL ADDRESS" maxWidth:[LayoutValues getMaxWidthClipped]];
emailField.textField.autocapitalizationType = UITextAutocapitalizationTypeNone;
LinearLayoutButton *continueButton = [[LinearLayoutButton alloc] initWithText:@"SIGN IN" maxWidth:[LayoutValues getMaxWidthClipped] url:nil type:@"primary"];
[self.topContainerContent addObject:continueButton];
LinearLayoutLinksViewItem *noticesPar = [[LinearLayoutLinksViewItem alloc] initLinksViewWithText:@"By clicking Sign In you agree to our Consent to Telehealth, Consent to Request Medical Services, Privacy Policy and Terms of Use." font:[PPFonts signInTermsParagraph] maxWidth:[LayoutValues getMaxWidthClipped] links:nil];
noticesPar.padding = CSLinearLayoutMakePadding(0, noticesPar.padding.left, 10, noticesPar.padding.right);
[self.topContainerContent addObject:noticesPar];
[self renderPageContainers];
firstPageLoad = YES;
}
@end
I am using custom created view controller but am getting a blank popup.
Is there a way to get the above layout using standard UIViewController
? I am new to iOS development and have not dynamically generated UI views so far.