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中各种常用控件的默认高度,很全

    1.状态栏 状态栏一般高度为20像素,在打手机或者显示消息时会放大到40像素高,注意,两倍高度的状态栏在好像只能在纵向的模式下使用.如下图   用户可以隐藏状态栏,也可以将状态栏设置为灰色,黑色或者半 ...

  2. iOS 按钮小知识点总结

    //设置按钮里面图片和文字的间距 btn.titleEdgeInsets=UIEdgeInsetsMake(0, 20, 0, 0); button.imageEdgeInsets = UIEdgeI ...

  3. Mac平台下启动MySQL到完全终止MySQL----终端八步走

    1.选中Finder的情况下,快捷键进入搜索目录:/usr/local 然后进入mysql目录下: 2.右键 "从这里启动" 打开终端: 3.输入执行:./scripts/mysq ...

  4. 大数据架构-使用HBase和Solr将存储与索引放在不同的机器上

    大数据架构-使用HBase和Solr将存储与索引放在不同的机器上 摘要:HBase可以通过协处理器Coprocessor的方式向Solr发出请求,Solr对于接收到的数据可以做相关的同步:增.删.改索 ...

  5. Merge Two Sorted Lists

    Merge Two Sorted Lists https://leetcode.com/problems/merge-two-sorted-lists/ Merge two sorted linked ...

  6. [转]excel set drop-down values based on vlookup

    本文转自:http://stackoverflow.com/questions/10657811/set-drop-down-values-based-on-vlookup 问: I have a w ...

  7. ASP.NET网站开发中的配置文件

    来源:微信公众号CodeL 1.配置文件层次分类 Machine.config:  对.netframework整体的配置 web.config(framework目录下):  对所有项目所公有的应用 ...

  8. 【OpenGL】交互式三次 Bezier 曲线

    1. 来源 三次贝塞尔曲线就是依据四个位置任意的点坐标绘制出的一条光滑曲线 2. 公式 3. 实现 #include <iostream> #include <math.h> ...

  9. 怎样绘制ZBrush中的纹理

    利用ZBrush的内置插件“投影大师”和“Polypainting”纹理贴图能够快速实现纹理的绘制.本文将对这两种方法的应用流程做一个介绍. 查看跟多内容请直接前往:http://www.zbrush ...

  10. 合工大OJ 1337 一加二减三

    Description 题目描述:给一个串,形如一+二-三,求值 Input 第一行为一个正整数T,表示数据的组数,接下来有T行每行都是一个形如一+二-三的串,一,二,三均为正整数 Output 对于 ...