GithubHelp home page GithubHelp logo

Comments (1)

francisvm avatar francisvm commented on August 31, 2024

You can achieve this by using a custom view.
Custom View
I would say this view is not adapted to this kind of use. The aim of it is to remain simple.

The custom view was added only for clients to use their own customized views.

The following code is an example of a custom view, creating only the UI. Adding the logic would become really ugly. This proves how the view is not adapted.

    UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 10, 300, 240)];

    UITextField *login = [[UITextField alloc] initWithFrame:CGRectMake(20, 0, 260, 30)];
    login.placeholder = @"Login";
    login.backgroundColor = [UIColor colorWithWhite:1 alpha:0.8];
    login.textColor = [UIColor blackColor];
    login.borderStyle = UITextBorderStyleRoundedRect;
    login.textAlignment = NSTextAlignmentLeft;
    [contentView addSubview:login];

    UITextField *password = [[UITextField alloc] initWithFrame:CGRectMake(20, 40, 260, 30)];
    password.placeholder = @"Password";
    password.backgroundColor = [UIColor colorWithWhite:1 alpha:0.8];
    password.textColor = [UIColor blackColor];
    password.borderStyle = UITextBorderStyleRoundedRect;
    password.textAlignment = NSTextAlignmentLeft;
    [contentView addSubview:password];

    UIButton *okButton = [UIButton buttonWithType:UIButtonTypeSystem];
    okButton.frame = CGRectMake(20, 90, 85, 30);
    [okButton setTitle:@"OK" forState:UIControlStateNormal];
    okButton.titleLabel.textAlignment = NSTextAlignmentCenter;
    [okButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [contentView addSubview:okButton];

    UIButton *forgotButton = [UIButton buttonWithType:UIButtonTypeSystem];
    forgotButton.frame = CGRectMake(105, 90, 85, 30);
    [forgotButton setTitle:@"Forgot" forState:UIControlStateNormal];
    forgotButton.titleLabel.textAlignment = NSTextAlignmentCenter;
    [forgotButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [contentView addSubview:forgotButton];

    UIButton *cancelButton = [UIButton buttonWithType:UIButtonTypeSystem];
    cancelButton.frame = CGRectMake(190, 90, 85, 30);
    [cancelButton setTitle:@"Cancel" forState:UIControlStateNormal];
    cancelButton.titleLabel.textAlignment = NSTextAlignmentCenter;
    [cancelButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [contentView addSubview:cancelButton];


    UIColor *bgColor = [UIColor colorWithWhite:1 alpha:0.1];

    [FVCustomAlertView showAlertOnView:self.view withTitle:@"Log in" titleColor:[UIColor whiteColor] width:300 height:180 blur:YES backgroundImage:nil backgroundColor:bgColor cornerRadius:20 shadowAlpha:0.2 alpha:0.8 contentView:contentView type:FVAlertTypeCustom allowTap:NO];

from fvcustomalertview.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.