小编cor*_*aft的帖子

如何快速去除inputView下的灰色层

我试图让我的 Inputview 的背景透明,但我只把它变成灰色。

在此处输入图片说明

代码是:

    let fakeField : UITextField = UITextField(frame: CGRect.zero)
    //1
    InputViewCollection = InputView(frame: CGRect(x: 0, y: 0, width: 0, height: 216)) //Intialize custom input view
    InputViewCollection?.delegate = self //delegate
    InputViewCollection?.dataSource = self //datasource

    //2
    InputViewCollection?.backgroundColor = UIColor.clear
    self.fakeField.inputView = InputViewCollection //Assign input view
    self.fakeField.keyboardAppearance = .default
    self.view.addSubview(self.fakeField)
Run Code Online (Sandbox Code Playgroud)

如何离开输入视图的透明背景?

谢谢

uitextfield ios inputview swift

2
推荐指数
1
解决办法
952
查看次数

标签 统计

inputview ×1

ios ×1

swift ×1

uitextfield ×1