<i id='PjXFF'><tr id='PjXFF'><dt id='PjXFF'><q id='PjXFF'><span id='PjXFF'><b id='PjXFF'><form id='PjXFF'><ins id='PjXFF'></ins><ul id='PjXFF'></ul><sub id='PjXFF'></sub></form><legend id='PjXFF'></legend><bdo id='PjXFF'><pre id='PjXFF'><center id='PjXFF'></center></pre></bdo></b><th id='PjXFF'></th></span></q></dt></tr></i><div id='PjXFF'><tfoot id='PjXFF'></tfoot><dl id='PjXFF'><fieldset id='PjXFF'></fieldset></dl></div>
<legend id='PjXFF'><style id='PjXFF'><dir id='PjXFF'><q id='PjXFF'></q></dir></style></legend>

  1. <tfoot id='PjXFF'></tfoot>

    <small id='PjXFF'></small><noframes id='PjXFF'>

    • <bdo id='PjXFF'></bdo><ul id='PjXFF'></ul>

      将按钮添加到 UIPickerView - Swift 1.2

      Add buttons to UIPickerView - Swift 1.2(将按钮添加到 UIPickerView - Swift 1.2)

        <small id='xB26y'></small><noframes id='xB26y'>

          <tfoot id='xB26y'></tfoot>
        1. <legend id='xB26y'><style id='xB26y'><dir id='xB26y'><q id='xB26y'></q></dir></style></legend>
              <i id='xB26y'><tr id='xB26y'><dt id='xB26y'><q id='xB26y'><span id='xB26y'><b id='xB26y'><form id='xB26y'><ins id='xB26y'></ins><ul id='xB26y'></ul><sub id='xB26y'></sub></form><legend id='xB26y'></legend><bdo id='xB26y'><pre id='xB26y'><center id='xB26y'></center></pre></bdo></b><th id='xB26y'></th></span></q></dt></tr></i><div id='xB26y'><tfoot id='xB26y'></tfoot><dl id='xB26y'><fieldset id='xB26y'></fieldset></dl></div>
                <bdo id='xB26y'></bdo><ul id='xB26y'></ul>
                  <tbody id='xB26y'></tbody>
                本文介绍了将按钮添加到 UIPickerView - Swift 1.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想在 UIPickerView 中添加两个 UIButtons(在它上面).请查看此图中的 CancelDone 按钮:

                I would like to add two UIButtons in the UIPickerView (on top of it). Please take a look at the Cancel and Done buttons in this image:

                我该怎么做?

                推荐答案

                我已经解决了,用 Swift 回答:

                I have solved this, answer in Swift:

                var pickerView = UIPickerView(frame: CGRectMake(0, 200, view.frame.width, 300))
                pickerView.backgroundColor = .whiteColor()
                pickerView.showsSelectionIndicator = true
                
                var toolBar = UIToolbar()
                toolBar.barStyle = UIBarStyle.Default
                toolBar.translucent = true
                toolBar.tintColor = UIColor(red: 76/255, green: 217/255, blue: 100/255, alpha: 1)
                toolBar.sizeToFit()
                
                
                let doneButton = UIBarButtonItem(title: "Done", style: UIBarButtonItemStyle.Bordered, target: self, action: "donePicker")
                let spaceButton = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil)
                let cancelButton = UIBarButtonItem(title: "Cancel", style: UIBarButtonItemStyle.Bordered, target: self, action: "canclePicker")
                
                toolBar.setItems([cancelButton, spaceButton, doneButton], animated: false)
                toolBar.userInteractionEnabled = true
                
                textField.inputView = pickerView
                textField.inputAccessoryView = toolBar
                

                这篇关于将按钮添加到 UIPickerView - Swift 1.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                UIButton title text color(UIButton 标题文本颜色)
                Stretch background image for UIButton(为 UIButton 拉伸背景图像)
                Using Tint color on UIImageView(在 UIImageView 上使用 Tint 颜色)
                How can I change UIButton title color?(如何更改 UIButton 标题颜色?)
                iPhone UIButton - image position(iPhone UIButton - 图像位置)
                UIButton remove all target-actions(UIButton 删除所有目标动作)
                • <tfoot id='8h47P'></tfoot>

                  • <bdo id='8h47P'></bdo><ul id='8h47P'></ul>
                  • <legend id='8h47P'><style id='8h47P'><dir id='8h47P'><q id='8h47P'></q></dir></style></legend>
                      <tbody id='8h47P'></tbody>

                        <small id='8h47P'></small><noframes id='8h47P'>

                        • <i id='8h47P'><tr id='8h47P'><dt id='8h47P'><q id='8h47P'><span id='8h47P'><b id='8h47P'><form id='8h47P'><ins id='8h47P'></ins><ul id='8h47P'></ul><sub id='8h47P'></sub></form><legend id='8h47P'></legend><bdo id='8h47P'><pre id='8h47P'><center id='8h47P'></center></pre></bdo></b><th id='8h47P'></th></span></q></dt></tr></i><div id='8h47P'><tfoot id='8h47P'></tfoot><dl id='8h47P'><fieldset id='8h47P'></fieldset></dl></div>