1. ReactNative中能使用的css样式有哪些呢
    Valid style props: [

      "alignItems",

      "alignSelf",

      "backfaceVisibility",

      "backgroundColor",

      "borderBottomColor",

      "borderBottomLeftRadius",

      "borderBottomRightRadius",

      "borderBottomWidth",

      "borderColor",

      "borderLeftColor",

      "borderLeftWidth",

      "borderRadius",

      "borderRightColor",

      "borderRightWidth",

      "borderStyle",

      "borderTopColor",

      "borderTopLeftRadius",

      "borderTopRightRadius",

      "borderTopWidth",

      "borderWidth",

      "bottom",

      "color",

      "elevation",

      "flex",

      "flexDirection",

      "flexWrap",

      "fontFamily",

      "fontSize",

      "fontStyle",

      "fontWeight",

      "height",

      "justifyContent",

      "left",

      "letterSpacing",

      "lineHeight",

      "margin",

      "marginBottom",

      "marginHorizontal",

      "marginLeft",

      "marginRight",

      "marginTop",

      "marginVertical",

      "opacity",

      "overflow",

      "overlayColor",

      "padding",

      "paddingBottom",

      "paddingHorizontal",

      "paddingLeft",

      "paddingRight",

      "paddingTop",

      "paddingVertical",

      "position",

      "resizeMode",

      "right",

      "rotation",

      "scaleX",

      "scaleY",

      "shadowColor",

      "shadowOffset",

      "shadowOpacity",

      "shadowRadius",

      "textAlign",

      "textAlignVertical",

      "textDecorationColor",

      "textDecorationLine",

      "textDecorationStyle",

      "textShadowColor",

      "textShadowOffset",

      "textShadowRadius",

      "tintColor",

      "top",

      "transform",

      "transformMatrix",

      "translateX",

      "translateY",

      "width",

      "writingDirection"]

  2. style使用内连方式 style={{flex:1,borderColor:'red'}}
  3. style包裹使用style={[styles.style1,styles.style2]}
  4. 同时包裹样式和内连style={[styles.style1,{flex:1,borderWidth:1}]}
  5. StyleSheet提供了一种类似CSS样式表的抽象。

    创建一个样式表:

    var styles = StyleSheet.create({
      container: {
        borderRadius: 4,
        borderWidth: 0.5,
        borderColor: '#d6d7da',
      },
      title: {
        fontSize: 19,
        fontWeight: 'bold',
      },
      activeTitle: {
        color: 'red',
      },
    });
    

    使用一个样式表:

    <View style={styles.container}>
      <Text style={[styles.title, this.props.isActive && styles.activeTitle]} />
    </View>

ReactNative高级交流群 127482131 或访问  ReactNative技术专题

ReactNative之style使用指南的更多相关文章

  1. ReactNative真机运行指南

    ReactNative真机运行指南 注意在iOS设备上运行React Native应用需要一个Apple Developer account并且把你的设备注册为测试设备.本向导只包含React Nat ...

  2. React-Native——html/css

    做前端开发,熟悉了HTML+CSS+JS的开发模式,如果不看RN原理,直接用老一套的逻辑思维上手RN,可能会大跌眼镜.高效开发的前提,需要学习并理解RN的原理.本文主要记录内容是,关于RN开发的HTM ...

  3. 超级简单 一分钟实现react-native屏幕适配

    今天因为react-native的style只能给width和height设置数字 没有react上的vw和vh 因为之前经常用vh vw 感觉不适应 找到了一个新的方法 使用Demension模块 ...

  4. React Native常用组件之TabBarIOS、TabBarIOS.Item组件、Navigator组件、NavigatorIOS组件、React Navigation第三方

    以下内容为老版本React Native,faceBook已经有了新的导航组件,请移步其他博客参考>>[我是传送门] 参考资料:React Navigation  react-native ...

  5. [React Native] State and Touch Events -- TextInput, TouchableHighLight

    In React, components manage their own state. In this lesson, we'll walk through building a component ...

  6. [React Native] Basic iOS Routing -- NavigatorIOS

    Inside the app component, we use NavigatiorIOS to render the compoent: class githubnotetaker extends ...

  7. avalon2学习教程05属性操作

    avalon2与avalon1的属性操作虽然都是使用ms-attr,但用法完全不一样. avalon1是这样操作属性的 其语法为 ms-attr-valueName="vmProp" ...

  8. 【Facebook的UI开发框架React入门之八】Image的使用简单介绍(iOS平台)-goodmao

    --------------------------------------------------------------------------------------------------- ...

  9. 【Facebook的UI开发框架React入门之九】button简单介绍(iOS平台)-goodmao

    --------------------------------------------------------------------------------------------------- ...

随机推荐

  1. iOS开发之网络编程--6、NSURLSessionConfiguration笔记

    NSURLSessionConfiguration对象用于初始化NSURLSession对象. 展开请求级别中与NSMutableURLRequest相关的可供选择的方案,我们可以看到NSURLSes ...

  2. 小波说雨燕 第三季 构建 swift UI 之 UI组件集-视图集(四)Alert View视图 学习笔记

    当我们的应用电量不足的时候,就需要警告提示,那么我们可以用Alert View视图 实现:    

  3. IOS之Foundation之探究学习Swift实用基础整理<一>

    import Foundation //加载网络数据,查找数据的字符串 let dataurl = "http://api.k780.com:88/?app=weather.city& ...

  4. 用Leangoo做敏捷需求管理-敏捷团队协作

    传统的瀑布工作模式使用详细的需求说明书来表达需求,需求人员负责做需求调研,根据调研情况编制详细的需求说明书,进行需求评审,评审之后签字确认交给研发团队设计开发.在这样的环境下,需求文档是信息传递的主体 ...

  5. python正则表达式 小例几则

    会用到的语法 正则字符 释义 举例 + 前面元素至少出现一次 ab+:ab.abbbb 等 * 前面元素出现0次或多次 ab*:a.ab.abb 等 ? 匹配前面的一次或0次 Ab?: A.Ab 等 ...

  6. 系统调用wait、waitpid和exec函数

    本文介绍了Linux下的进程的一些概念,并着重讲解了与Linux进程管理相关的重要系统调用wait,waitpid和exec函数族,辅助一些例程说明了它们的特点和使用方法. 1.7 背景 在前面的文章 ...

  7. 迅为iTOP-4412核心板调整电压

    本文转自:http://www.topeetboard.com iTOP-4412核心板使用的电源管理芯片是三星专门针对4412研发的S5M8767,8767提供9路BUCK和28路LDO输出,每路电 ...

  8. FDTD Python API

    源代码 #!/usr/bin/env python from math import exp from gnuplot_leon import * imp0 = 377.0 class fdtd_le ...

  9. Half Wavelength Dipole Antenna

    Reference : 1. wikipedia The dipole antenna is the simplest and most widely used class of antenna.It ...

  10. selenium如何分别启动IE、firefox、chrome浏览器

    1.火狐浏览器 /* * 初始化火狐浏览器 * */ public static WebDriver initFireFox(WebDriver dr) { String key = "we ...