swift playground UITextField spawns keyboard that is too big

前端 未结 3 629
再見小時候
再見小時候 2021-02-08 04:26

Swift in playground on Mac OS. When the user clicks in a UItextfield, a keyboard spawns but it is very large compared to the view and only the first few keys are available.

3条回答
  •  难免孤独
    2021-02-08 05:05

    In reply to Adobels (Seo 21 '19) ...

    I am not sure why he proposed a different approach.

    I modified dr_barlo's approach of Oct 22 '17 as follows (and it works in Xcode 11 too):

    let vc = TextFieldViewController()
    vc.preferredContentSize = CGSize.init(width: 768,height: 1024)
    PlaygroundPage.current.liveView = vc
    

    They all appear equivalent in results if not internal workings.

提交回复
热议问题