返回密钥不在IB或代码中更改

时间:2017-02-06 04:00:50

标签: ios swift swift3 interface-builder

用这个把头发拉出来。使用xCode 8.2.1并尝试更改"返回键"在键盘上。

尝试:

  1. 通过Interface Builder进行设置: enter image description here

  2. 通过代码:

  3. #include <iostream>
    #include <sstream>
    #include <Windows.h>
    #include <string>
    
    int *char_to_pointer(std::string input);
    
    int main() {
        int sample = 100; // lets say this address is 0xc1f1
        std::string input_;
        std::cout << "addr:" << &sample << std::endl;
        std::cout << "what is the memory address?:" << std::endl;
        std::cin >> input_;
    
        int *inp = char_to_pointer(input_);
        std::cout << "imp: " << inp << std::endl;
        std::cout << "imp*: " << *inp << std::endl;//This was my solution
        std::cout << "imp&: " << &inp << std::endl;
    
        Sleep(10000);
    
        return 0;
    }
    
    int *char_to_pointer(std::string input) {
        return (int *)std::stoul(input, nullptr, 16);
    }
    

    我可以确认IBOutlet @IBOutlet var password : UITextField? override open func viewDidLoad() { password?.returnKeyType = .next password?.reloadInputViews() } 也已设置。

    这发生在我在应用程序中的每个故事板视图中,没有任何改变键盘设置。

    模拟器和设备上的结果相同。

    enter image description here

1 个答案:

答案 0 :(得分:0)

我可以证明 的工作原理。我这样做了:

enter image description here

我得到了这个(注意右下方的键):

enter image description here