GitHub user kfeagle opened a pull request:

    https://github.com/apache/incubator-weex/pull/233

    + [ios] picker support custom title title color background color and etc

    + [ios] picker support custom 
    
    title
    titleColor
    cancelTitle
    confirmTitle
    cancelTitleColor
    confirmTitleColor
    titleBackgroundColor
    height
    textColor
    selectionColor
    
    demo
    
    ```
    <template>
      <scroller>
        <wxc-panel title="picker module" type="primary">
          <text style="margin-bottom: 20px;">pick value: {{value}}</text>
          <wxc-button type="primary" onclick="{{pick}}" value="single pick" 
style="margin-bottom: 20px;"></wxc-button>
          <wxc-button type="primary" onclick="{{pickDate}}" value="pickDate" 
style="margin-bottom: 20px;"></wxc-button>
          <wxc-button type="primary" onclick="{{pickTime}}" 
value="pickTime"></wxc-button>
        </wxc-panel>
    
        <wxc-panel title="input component" type="primary">
          <text>onchange: {{txtChange}}</text>
          <input
                  type="date"
                  placeholder="select date"
                  class="input"
                  autofocus="false"
                  value=""
                  onchange="onchange"
                  max = "2029-11-28"
                  min = "2015-11-28"
          />
          <input
                  type="time"
                  placeholder="select time"
                  class="input"
                  autofocus="false"
                  value=""
                  onchange="onchange"
          />
        </wxc-panel>
      </scroller>
    </template>
    
    <style>
      .input {
        font-size: 60px;
        height: 80px;
        width: 400px;
      }
    </style>
    
    <script>
      require('weex-components');
      module.exports = {
        data: {
          value: '',
          index: 0,
          txtChange: ''
        },
        methods: {
          pick: function() {
            var picker = require('@weex-module/picker');
            var items = new Array("Saab","Volvo","BMW");
            var self = this;
            picker.pick({
              'items':items,
              'index':self.index,
              'title':'test',
              'titleColor':'blue',
              'cancelTitle':'cccc',
              'confirmTitle':'dddd',
              'cancelTitleColor':'black',
              'confirmTitleColor':'yellow',
              'titleBackgroundColor':'green',
              'height':600,
              'textColor':'red',
              'selectionColor':'gray'
            },function (ret) {
              var result = ret.result;
              if(result == 'success')
              {
                self.value = items[ret.data];
                self.index = ret.data;
              }
            });
    
          },
          pickDate: function() {
            var picker = require('@weex-module/picker');
            var self = this;
            picker.pickDate({
              'value':'2016-11-28',
              'max':'2029-11-28',
              'min':'2015-11-28'
            },function (ret) {
              var result = ret.result;
              if(result == 'success')
              {
                self.value = ret.data;
              }
            });
          },
          pickTime: function() {
            var picker = require('@weex-module/picker');
            var self = this;
            picker.pickTime({
              'value':'19:24'
            },function (ret) {
              var result = ret.result;
              if(result == 'success')
              {
                self.value = ret.data;
              }
            });
          },
          onchange: function(event) {
            this.txtChange = event.value;
            console.log('onchange', event.value);
          }
        }
      }
    </script>
    
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kfeagle/incubator-weex 
ios-feature-picker-0.12-dev

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-weex/pull/233.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #233
    
----
commit 151b3fdbe5d0e479a5baa17e6d56987588af673a
Author: 齐山 <[email protected]>
Date:   2017-04-07T09:44:20Z

    + [ios] picker support custom title title color background color and etc

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to