New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from Apr 11, 2017

Conversation

Projects
None yet
3 participants
@kfeagle
Contributor

kfeagle commented Apr 7, 2017

  • [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>

doneBtn = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done:)];
}
if(self.confirmTitleColor){
doneBtn.tintColor = self.confirmTitleColor;

This comment has been minimized.

@bluebird78999

bluebird78999 Apr 10, 2017

Contributor

confirmTitleColor is a text's color or a tintColor?

@bluebird78999

bluebird78999 Apr 10, 2017

Contributor

confirmTitleColor is a text's color or a tintColor?

This comment has been minimized.

@kfeagle

kfeagle Apr 10, 2017

Contributor

confirmTitleColor is a text's color

@kfeagle

kfeagle Apr 10, 2017

Contributor

confirmTitleColor is a text's color

@asfgit asfgit merged commit cddebfb into apache:0.12-dev Apr 11, 2017

1 check failed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment