Not able to type in textfield in iphone simulator using Mac Keyboard?

前端 未结 30 1260
小蘑菇
小蘑菇 2020-12-23 15:47

I\'m working on a basic iOS app which supports both portrait and landscape modes. When the iPhone simulator keyboard is open in landscape and I\'m switching the app

30条回答
  •  不思量自难忘°
    2020-12-23 16:16

    There is a library for editing plist files called plistlib. Here is my code:

        import plistlib
    
        file_name = ('path/to/com.apple.iphonesimulator.plist')
        try:
            p = plistlib.readPlist(file_name)
            p["ConnectHardwareKeyboard"] = "NO"
            plistlib.writePlist(p, file_name)
        except:
            print("Failure")
    

    This reads the plist file, changes the ConnectHardwareKeyboard value to No and then writes the new file to the same location. This works for me, but let me know if there is a better way to do it. I'm still new at coding.

提交回复
热议问题