zoukankan      html  css  js  c++  java
  • Touchable类组件

    Touchable
    /*
    * React Native中提供3个组件用于给其他没有触摸事件的组件,绑定触摸事件
    * TouchableOpacity 透明触摸,点击时,组件会出现透明过渡的效果
    * TouchableHighlight 高亮触摸,点击时,组件会出现高亮效果
    * TouchableWithoutFeedback 无反馈触摸,点击时,组件无视觉变化
    *
    * 需要导入组件
    *
    *
    * */

    var LessionTouchable = React.createClass({

    /* 绑定事件 onPress*/
    clickBtn:function () {
    alert("点击搜索按钮")
    },

    render:function () {
    return(
    <View sytle={styles.container}>
    <View style={styles.flex}>
    <View style={styles.input}>
    </View>
    </View>
    <TouchableOpacity style={styles.btn}>
    <Text style={styles.search} onPress={this.clickBtn}>搜索</Text>
    </TouchableOpacity>
    </View>
    );
    }
    });

    var styles = StyleSheet.create({
    container:{
    flexDirection:"row",
    height:45,
    marginTop:25
    },
    flex:{
    flex:1
    },
    input:{
    height:45,
    borderWidth:1,
    borderColor:"#CCC",
    borderRadius:4,
    marginLeft:5,
    padding:5,
    },
    btn:{
    55,
    marginLeft:5,
    marginRight:5,
    backgroundColor:"blue",
    height:45,
    justifyContent:"center",
    alignItems:"center"
    },
    search:{
    color:"#FFF"
    }
    });
  • 相关阅读:
    AtCoder ABC 129F Takahashi's Basics in Education and Learning
    AtCoder ABC 129E Sum Equals Xor
    UVA 511 Do You Know the Way to San Jose?
    UVA 12504 Updating a Dictionary
    [Poi2000] 病毒
    [loj10061] 最短母串
    [Poi2010] Antisymmetry
    校内集训20181003
    校内集训20181001
    校内集训20180925
  • 原文地址:https://www.cnblogs.com/daxueshan/p/7979604.html
Copyright © 2011-2022 走看看