Custom UI: Popup in iOS Objective-C

Ich möchte erstellen Sie eine benutzerdefinierte popup, und ich will erzeugen einen code, der dynamisch ohne Verwendung von UI-drag-and-drop.

Sollte die Ansicht so Aussehen:

Custom UI: Popup in iOS Objective-C

Ich bin mit dem folgenden code, um das popup :

 CustomPopUp *cp = [[CustomPopUp alloc]init];
 cp.view.frame = CGRectMake(0.0, 0.0, 300, 300);
 KLCPopup* popup = [KLCPopup popupWithContentView:cp.view];
 [popup show];

Benutzerdefinierte popup-code sieht wie folgt aus:

- (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

Ich bin mit custom erstellt view-controller aber bin immer ein leeres popup.

Ist es ein Weg, um die oben layout mit standard -UIViewController? Ich bin neu in der iOS-Entwicklung und nicht dynamisch generiert UI-Ansichten so weit.

InformationsquelleAutor Ackman | 2016-12-23
Schreibe einen Kommentar