     }
     
     func setupInputAccessoryView() {
-        inputButtons = UINavigationBar(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 44))
-        inputButtons!.barStyle = UIBarStyle.default;
-        inputButtons!.backgroundColor = UIColor(netHex: 0xEEEEEE);
-        inputButtons!.alpha = 1;
-        let frame =  CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width / 2, height: 40)
-        
-        let buttonNext = UIButton(frame: frame)
-        buttonNext.setTitle("Continuar".localized, for: .normal)
-        buttonNext.addTarget(self, action: #selector(CardFormViewController.rightArrowKeyTapped), for: .touchUpInside)
-        buttonNext.setTitleColor(UIColor(netHex:0x007AFF), for: .normal)
-        
-        let buttonPrev = UIButton(frame: frame)
-        buttonPrev.setTitle("Anterior".localized, for: .normal)
-        buttonPrev.addTarget(self, action: #selector(CardFormViewController.leftArrowKeyTapped), for: .touchUpInside)
-        buttonPrev.setTitleColor(UIColor(netHex:0x007AFF), for: .normal)
-        
-        /*
-         if let font = UIFont(name:MercadoPago.DEFAULT_FONT_NAME, size: 14) {
-         buttonNext.setTitleTextAttributes([NSFontAttributeName: font], forState: UIControlState.Normal)
-         buttonPrev.setTitleTextAttributes([NSFontAttributeName: font], forState: UIControlState.Normal)
-         }
-         */
-        navItem = UINavigationItem()
-        doneNext = UIBarButtonItem(customView: buttonNext)
-        donePrev = UIBarButtonItem(customView: buttonPrev)
-        
-        
-        donePrev?.setTitlePositionAdjustment(UIOffset(horizontal: UIScreen.main.bounds.size.width / 8, vertical: 0), for: UIBarMetrics.default)
-        doneNext?.setTitlePositionAdjustment(UIOffset(horizontal: -UIScreen.main.bounds.size.width / 8, vertical: 0), for: UIBarMetrics.default)
-        navItem!.rightBarButtonItem = doneNext
-        navItem!.leftBarButtonItem = donePrev
-        
-        
+        let frame =  CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 44)
+        let toolbar = UIToolbar(frame: frame)
+        
+        toolbar.barStyle = UIBarStyle.default;
+        toolbar.backgroundColor = UIColor(netHex: 0xEEEEEE);
+        toolbar.alpha = 1;
+        toolbar.isUserInteractionEnabled = true
+        
+        let buttonNext = UIBarButtonItem(title: "Continuar".localized, style: .done, target: self, action: #selector(CardFormViewController.rightArrowKeyTapped))
+        let buttonPrev = UIBarButtonItem(title: "Anterior".localized, style: .plain, target: self, action: #selector(CardFormViewController.leftArrowKeyTapped))
+        
+        
+        if let font = UIFont(name:MercadoPago.DEFAULT_FONT_NAME, size: 14) {
+            buttonNext.setTitleTextAttributes([NSFontAttributeName: font], for: .normal)
+            buttonPrev.setTitleTextAttributes([NSFontAttributeName: font], for: .normal)
+        }
+        buttonNext.setTitlePositionAdjustment(UIOffset(horizontal: UIScreen.main.bounds.size.width / 8, vertical: 0), for: UIBarMetrics.default)
+        buttonPrev.setTitlePositionAdjustment(UIOffset(horizontal: -UIScreen.main.bounds.size.width / 8, vertical: 0), for: UIBarMetrics.default)
+        
+        doneNext = buttonNext
+        donePrev = buttonPrev
+        
+        let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: nil, action: nil);
+        
+        toolbar.items = [flexibleSpace, donePrev!, flexibleSpace, doneNext!, flexibleSpace]
         if self.cardFormManager.customerCard != nil || self.cardFormManager.token != nil{
             navItem!.leftBarButtonItem?.isEnabled = false
         }
-        inputButtons!.pushItem(navItem!, animated: false)
-        textBox.inputAccessoryView = inputButtons
+        
+        textBox.delegate = self
+        self.toolbar = toolbar
+        textBox.inputAccessoryView = toolbar
+        
         
         
     }
     
     func showErrorMessage(_ errorMessage:String){
         
-        errorLabel = MPLabel(frame: inputButtons!.frame)
+        errorLabel = MPLabel(frame: toolbar!.frame)
         self.errorLabel!.backgroundColor = UIColor(netHex: 0xEEEEEE)
         self.errorLabel!.textColor = UIColor(netHex: 0xf04449)
         self.errorLabel!.text = errorMessage

    func hideErrorMessage(){
        self.textBox.borderInactiveColor = UIColor(netHex: 0x3F9FDA)
        self.textBox.borderActiveColor = UIColor(netHex: 0x3F9FDA)
        self.textBox.inputAccessoryView = self.inputButtons
        self.textBox.setNeedsDisplay()
        self.textBox.resignFirstResponder()
        self.textBox.becomeFirstResponder()

    
    static public var showBankDeals = true
    
    var toolbar : UIToolbar?
    var errorLabel : MPLabel?
    
    var navItem : UINavigationItem?
