alertView 上添加textField
- (void)showTextFieldUIAlertView
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"请输入消费金额" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
[[alertView textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeNumberPad];
[alertView show];
}
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
UITextField *txt = [alertView textFieldAtIndex:0];
   
if (buttonIndex == 1) //确定
{
if (txt.text.length > 0)
{
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"请输入消费金额" message:nil delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alertView.alertViewStyle = UIAlertViewStylePlainTextInput;
[[alertView textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeNumberPad];
[alertView show];
}
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
UITextField *txt = [alertView textFieldAtIndex:0];
if (buttonIndex == 1) //确定
{
if (txt.text.length > 0)
{
        controller.strTotalFee = txt.text;
        else
        {
[SVProgressHUD showErrorWithStatus:@"金额不能为空!"];
}
}
[SVProgressHUD showErrorWithStatus:@"金额不能为空!"];
}
}
}
posted on 2015-09-30 17:39 taiyang2014 阅读(339) 评论(0) 收藏 举报
 
                    
                     
                    
                 
                    
                 
                
            
         
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号