Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/113.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Swift:SLKTextViewController';不查看“左”按钮_Ios_Swift_Uibutton - Fatal编程技术网

Ios Swift:SLKTextViewController';不查看“左”按钮

Ios Swift:SLKTextViewController';不查看“左”按钮,ios,swift,uibutton,Ios,Swift,Uibutton,我正在使用SLKTextViewController构建带有两个按钮的聊天dockview 我想要带UIPopOverController的左键拍照等等 class Message: SLKTextViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. sel

我正在使用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)
然后可以在CameraPressed函数中添加UIPopOverController。(不过我更喜欢UIAlertController样式)