Ios Swift:SLKTextViewController';不查看“左”按钮
我正在使用SLKTextViewController构建带有两个按钮的聊天dockview 我想要带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
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样式)