ログインページ

1966 ワード

ログインページは、簡単なレイアウトコントロールに加えて、使用する方法のテクニック:1.コントロールの透明度を設定コントロールの透明度を設定するとき、alphaを使用すると、透明性を望んでいない部分も透明になります.たとえば、textFieldの透明度を設定すると、入力したフォントの内容も透明になりますが、これは私たちが望んでいるものではありません.解決方法:UICOLOR*color=[UICOLOR color WidhRed:135/255.0 green:206/255.0 blue:250/255.0 alpha:1];accountText.backgroundColor = [color colorWithAlphaComponent:0.7]; この方法では、コントロール自体を透明にし、フォントを不透明にすることができます.2.コントロールフィレット_accountText.layer.cornerRadius = 5; _accountText.layer.masksToBounds = YES; 3.ポップアップ入力ボックスUIBarButtonItem*leftBtn=[[UIBarButtonItem alloc]initWithTitle:@"私は管理者です"style:UIBarButtonItemStylePlain target:self action:@selector(manageLogin)];self.navigationItem.leftBarButtonItem = leftBtn; -(void)manageLogin{UIAlertController*alertController=[UIAlertController alertController WithTitle:@ヒントメッセージ:@管理者ログインpreferredStyle:UIAlertControllerStyleAlert];//////////////////////////////////////////////////////////////////[ alertController addActionWithTitle:@[OK]style:UIAlertActionStyleDefaulthandler:^(UIAlertActionActionActionActionWithTitActionWithTitTitTitTitTitTitTitTitTitTitTitTityle:@[OK]styl*_Nonnullaction){//1番目の入力ボックスの取得;UItextField*userName TextField=alertControl.textFields.firstObject;//2番目の入力ボックスの取得;UItextField*passwordTextField=alertControl.textFields.lastObject;
     NSLog(@"    = %@,   = %@",userNameTextField.text,passwordTextField.text);
    
}]];

//      ;
[alertController addAction:[UIAlertAction actionWithTitle:@"  " style:UIAlertActionStyleDefault handler:nil]];

//        ;
[alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
    textField.placeholder = @"     ";
}];
//        ;
    [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {
        textField.placeholder = @"     ";
        textField.secureTextEntry = YES;
    }];

[self presentViewController:alertController animated:true completion:nil];

}