import React,{Component}from 'react';
import {
AppRegistry, StyleSheet,
Text,
View,
SliderIOS,
} from 'react-native'; class SliderIOSDemo extends Component {
constructor(props){
super(props);
this.state={
value:0,
};
}
render() {
return (
<View> <Text style={{marginLeft:10}}>默认的SliderIOS</Text>
<SliderIOS style={{margin:10}}
onSlidingComplete={()=>console.log('当前的值为'+this.state.value)}
onValueChange={(value)=>this.setState({value:value})}
/>
<Text style={{marginLeft:10}}>设置SliderIOS无法滑动</Text>
<SliderIOS
style={{margin:10}}
disabled={true}
/>
<Text style={{marginLeft:10}}>定制SliderIOS</Text>
<SliderIOS style={{margin:10}}
value={0.4} onSlidingComplete={()=>console.log('当前的值为'+this.state.value)}
onValueChange={(value)=>this.setState({value:value})}
/>
</View>
);
}
}
const styles = StyleSheet.create({
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 20,
},
}); AppRegistry.registerComponent('Allen', () => SliderIOSDemo )

  备注:滑动后会用函数传递参数值

最新文章

  1. python 学习笔记十六 django深入学习一 路由系统,模板,admin,数据库操作
  2. SDL播放视频
  3. BZOJ4110 : [Wf2015]Evolution in Parallel
  4. eclipse菜单解释及中英对照《二》
  5. 翻译:Knockout 轻松上手 - 1 Knockout 是什么?
  6. C#中利用委托实现多线程跨线程操作
  7. matlab特征值分解和奇异值分解
  8. verilog中的function用法与例子
  9. SqlLite 简明教程
  10. 小试牛刀-嘿嘿,创建job了
  11. UML基础知识
  12. Serializable 都这么牛逼了,Parcelable 还要你何用?
  13. Idea中右边的maven projects窗口找不到了如何调出来
  14. C++对一组pair数据进行排序(sort函数的使用)
  15. BZOJ4671异或图
  16. spring mvc jsonp调用示例
  17. MySQL--REPLACE INTO与自增
  18. python语法风格
  19. Win10系列:JavaScript多媒体
  20. 短信验证登陆-中国网建提供的SMS短信平台

热门文章

  1. elasticsearch 通过外网访问
  2. spring boot读取配置文件
  3. selenium python 启动Firefox
  4. 一些ios牛人的博客
  5. XenServer:使用XenCenter开设VPS(多图完整版)
  6. python 读取配置文件总是报错 configparser.NoSectionError: No section:
  7. 常用软件安装及VS插件工具
  8. Catch all the latest Jordan Release Dates
  9. 几乎考虑到了每个细节的php图片上传
  10. Python: 类中为什么要定义__init__()方法