gpt4 book ai didi

ios - swift : SLKTextViewController's left button is not viewed

转载 作者:搜寻专家 更新时间:2023-10-31 19:38:55 25 4
gpt4 key购买 nike

我正在使用 SLKTextViewController 构建带有两个按钮的聊天 dockview。

我想要带有 UIPopOverController 的左键用于拍照等。

class Message: SLKTextViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.textView.placeholder = "Message"
self.textView.placeholderColor = UIColor.lightGrayColor()
self.leftButton.setImage(UIImage(named: "icn_upload"), forState: UIControlState.Normal)
self.leftButton.tintColor = UIColor.grayColor()
self.rightButton.setTitle("Send", forState: UIControlState.Normal)
self.textInputbar.autoHideRightButton = true
self.textInputbar.maxCharCount = 31
self.textInputbar.counterStyle = SLKCounterStyle.Split
self.typingIndicatorView.canResignByTouch = true
self.bounces = true
self.shakeToClearEnabled = true
self.keyboardPanningEnabled = true
self.inverted = false

我添加它是为了让它出现,但它没有出现

        self.leftButton.hidden = false
}

最佳答案

如果需要显示左键,初始化即可。

self.leftButton.addTarget(self, action: Selector("cameraPressed"), 
forControlEvents: UIControlEvents.TouchUpInside)
self.leftButton.setImage(UIImage.init(named:"CameraIcon"), forState: UIControlState.Normal)

然后你可以在 camearPressed 函数中添加 UIPopOverController。 (虽然我更喜欢 UIAlertController 风格)

关于ios - swift : SLKTextViewController's left button is not viewed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32041271/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com