React Native组件之Text相当于iOS中的UILabel.

其基本属性如下:

/**
* Sample React Native App
* https://github.com/facebook/react-native
* 周少停 Text
* 2016-10-08
*/ import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native'; class Project extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.textViewStyle} numberOfLines={6}>
演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字,演示的文字
</Text>
</View>
);
}
} const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
textViewStyle:{
color:'red', //字体颜色
fontSize:23, //字体大小
fontStyle:'normal', //字体风格,枚举值,normal,bold
fontWeight: 'bold', //字体粗细权重,枚举值,normal,bold,100,200,300,400,500,600,700,800,900
textShadowOffset:{width:3, height:4}, //阴影效果
textShadowRadius: 2, //阴影效果圆角
textShadowColor:'yellow',//阴影效果颜色
letterSpacing:3 , //字符间距
lineHeight:80 , //行高
textAlign:'center', //文字对齐方式,枚举值:auto left right center justify
textDecorationLine:'underline', //横线位置,枚举值,none,underline,line-through,underline line-through
textDecorationStyle:'solid', //线的风格,solid double dotted dashed
textDecorationColor:'red', //线的颜色
writingDirection:'ltr' //文本方向.枚举值,auto,ltr,rtl
}
}); AppRegistry.registerComponent('Project', () => Project);

  完整源码下载:https://github.com/pheromone/React-Native-1

React Native组件之Text的更多相关文章

  1. React Native组件(三)Text组件解析

    相关文章 React Native探索系列 React Native组件系列 前言 此前介绍了最基本的View组件,接下来就是最常用的Text组件,对于Text组件的一些常用属性,这篇文章会给出简单的 ...

  2. React Native组件解析(二)之Text

    React Native组件解析(二)之Text 1. 概述 Text组件对应于iOS的UILabel,Android的TextView,用来显示文本.但是Text组件的内部使用的并不是flexbox ...

  3. React Native组件之Switch和Picker和Slide

    React Native组件Switch类似于iOS中的UISwitch:组件Slide类似于iOS中UIslider,组件Picker类似于iOS的UIPickerView.他们的使用方法和相关属性 ...

  4. beeshell —— 开源的 React Native 组件库

    介绍 beeshell 是一个 React Native 应用的基础组件库,基于 0.53.3 版本,提供一整套开箱即用的高质量组件,包含 JavaScript(以下简称 JS)组件和复合组件(包含 ...

  5. react native组件的生命周期

    react native组件的生命周期 一.当页面第一次加载时,会依次调用: constructor() componentWillMount(): 这个函数调用时机是在组件创建,并初始化了状态之后, ...

  6. react native组件的创建

    react native组件的创建 react文件加载顺序: react项目启动后,先加载index.js.在index.js中可以指向首页. import { AppRegistry } from ...

  7. React Native组件(二)View组件解析

    相关文章 React Native探索系列 React Native组件系列 前言 了解了RN的组件的生命周期后,我们接着来学习RN的具体的组件.View组件是最基本的组件,也是首先要掌握的组件,这一 ...

  8. 【RN - 基础】之React Native组件的生命周期

    下图描述了React Native中组件的生命周期: 从上图中可以看到,React Native组件的生命周期可以分为初始化阶段.存在阶段和销毁阶段. 实例化阶段 实例化阶段是React Native ...

  9. React Native 组件之TextInput

    React Native 组件之TextInput类似于iOS中的UITextView或者UITextField,是作为一个文字输入的组件,下面的TextInput的用法和相关属性. /** * Sa ...

随机推荐

  1. hdu 5749 Colmerauer

    题意:对于给定的$n \times m$矩阵$M$,定义$S(a,b)$为$M$的所有$a \times b$子矩阵的权重之和.一个矩阵的权重是指矩阵中所有马鞍点权值之和,在一个矩阵中某点是马鞍点当且 ...

  2. [问题2014A09] 解答

    [问题2014A09]  解答 通过简单的计算可得 \[(AB)^2=9AB,\cdots\cdots(1)\] 将 (1) 式的右边移到左边, 并将 \(A,B\) 分别提出可得 \[A(BA-9I ...

  3. VS2013: upgrading a Windows Phone 7/8 and Windows 8 apps(转)

    VS2013: upgrading a Windows Phone 7/8 and Windows 8 apps September 17, 2013Windows 8, Windows PhoneJ ...

  4. INSTALLMENT of QValue

    ############################################ INSTALLMENT############################################ ...

  5. Aggregation 聚集

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  6. jquery引用方法时传递参数

    经常到网上去下载大牛们写的js插件.每次只需将js引用并设置下变量就行了,但一直没搞明白原理(主要是大牛们的代码太简练了-,-). 这次弄清了如何传递.设置多个(很多个)参数. 如 方法为functi ...

  7. Model Binding

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...

  8. Codeforces Round #262 (Div. 2)

    A #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> ...

  9. CBUUID UUIDString unrecognized selector sent to instance 错误

    CBUUID UUIDString unrecognized selector sent to instance 错误 ios7.0,4s 蓝牙出现上述错误! 查看api可知,错误原因,由于CBUUI ...

  10. window绝对路径与相对路径

    绝对路径:是从盘符开始的路径,形如C:\windows\system32\cmd.exe相对路径:是从当前路径开始的路径,假如当前路径为C:\windows要描述上述路径,只需输入system32\c ...