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. Sublime Text怎么在切分两行视口内显示同一个文件

    原文链接:http://devlog.en.alt-area.org/?p=1098 How to split one file into two views in Sublime Text2 You ...

  2. [poj2828] Buy Tickets (线段树)

    线段树 Description Railway tickets were difficult to buy around the Lunar New Year in China, so we must ...

  3. centos中安装mysql数据库

    1.查看是否已有mysql数据库: #rpm -qa |grep mysql 命令返回空,说明没有安装成功. 2.安装mysql yum install mysql* 安装完成后,却发现只安装了JDB ...

  4. Chrome浏览器快捷键大全(新加了其他一些浏览器的独有)

    官方快捷键文档: https://support.google.com/chrome/answer/157179?hl=zh-Hans&ref_topic=14676   浏览器标签页和窗口快 ...

  5. sqlite创建表

    create table bike (id ) primary key, password ));

  6. PHP匿名函数的使用

    $dealer = array(); array_walk($dealer_id_arr,function($value) use(&$dealer) { $dealer[] = get_co ...

  7. java实现LIS算法,出操队形问题

    假设有序列:2,1,3,5,求一个最长上升子序列就是2,3,5或者1,3,5,长度都为3. LIS算法的思想是: 设存在序列a. ① 如果只有一个元素,那么最长上升子序列的长度为1: ② 如果有两个元 ...

  8. iOS - Xcode 配置

    1.Xcode 配置 1.1 OS X 1)main 文件注释修改路径: /Applications(应用程序) ▸ Xcode.app ▸ Contents ▸ Developer ▸ Librar ...

  9. Spring + Mybatis 使用 PageHelper 插件分页

    原文:http://www.cnblogs.com/yucongblog/p/5330886.html 先增加maven依赖: <dependency> <groupId>co ...

  10. 关于如何来构造一个String类

    今天帮着一位大二的学弟写了一个String的类,后来一想这个技术点,也许不是什么难点,但是还是简单的记录一些吧! 为那些还在路上爬行的行者,剖析一些基本的实现..... 内容写的过于简单,没有涉及到其 ...