react native SliderIOS
发布在react native2015年12月10日view:5365react-native
在文章任何区域双击击即可给文章添加【评注】!浮到评注点上可以查看详情。

中译为滑块,IOS提供的功能是很弱很弱的。可以对比一下OniUI有 slider,以后肯定要搞一个全新的。http://ued.qunar.com/oniui/index.html#!/widgets?widgetId=slider

slider {
  margin-: 30;
  height: 10;
}

text: {
  color: white;
  font-size: 16;
  margin-top: 20;
  line-height: 30;
}
textWrapper{
  flex:1;
  justify-content:center;
}

主程序为:


/**
 * 滑块 司徒正美
 */
'use strict';


var React = require('react-native');
var {
  StyleSheet,
  SliderIOS,
  Text,
  View,
  AppRegistry,
} = React;
var styles = require("./style")

var Slider = React.createClass({

  displayName: 'Tab',

  getInitialState: function() {
    return {
      value: 0
    };
  },

  render: function() {
    return (
      <View>

      <SliderIOS maximumValue={100} minmumValue={0}
      style={styles.slider}
      onValueChange={(value)=>{ this.setState({value: parseInt(value,10)}) }}
      />
      <View style={styles.textWrapper}><Text style={styles.text}>{this.state.value}</Text></View>
      </View>
    )
  },

});

AppRegistry.registerComponent('AwesomeProject', () => Slider);

enter image description here

评论
发表评论
暂无评论
WRITTEN BY
司徒正美
穿梭于二次元与二进制间的魔法师( ̄(工) ̄) 凸ส้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้้
TA的新浪微博
PUBLISHED IN
react native

用于放置react native的相关文章

友情链接 大搜车前端团队博客
我的收藏