博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何使用React Native样式表?
阅读量:2532 次
发布时间:2019-05-11

本文共 1433 字,大约阅读时间需要 4 分钟。

Without wasting much time, a style sheet as commonly known in a CSS is an object or block of code of many styling properties and values which is applied in a code when called.

在不浪费大量时间的情况下,CSS中通常已知的样式表是具有许多样式属性和值的代码的对象或代码块,该对象或代码块在调用时应用于代码中。

It's almost the same as in CSS but has a little different regarding some naming conventions.

它几乎与CSS中的相同,但在某些命名约定方面有所不同。

In react native, a style sheet is created by initiating a constant, assigning it to a styleSheet.create function as seen below.

在react native中,样式表是通过启动一个常量并将其分配给styleSheet.create函数创建的 ,如下所示。

The style sheet is then invoked or called by passing an inline style reference using a single curly brace.

然后通过使用单个花括号传递内联样式引用来调用或调用样式表。

Open your App.js file and type the following,

打开您的App.js文件,然后输入以下内容:

import * as React from 'react';import {
Text, View, StyleSheet, Button, TextInput } from 'react-native';export default function App() {
return (
);}const styles = StyleSheet.create({
box: {
padding: 50, }, container: {
flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', }, myinput: {
Width: '80%', borderBottomColor: 'black', padding: 10, borderBottomWidth: 1, },});

Output

输出量

How to use React Native style sheet?

Thanks for coding with me! See you @ the next article. Feel free to drop a comment or question. God Bless You!

感谢您与我编码! 下次见。 随意发表评论或问题。 上帝祝福你!

翻译自:

转载地址:http://httzd.baihongyu.com/

你可能感兴趣的文章
sql server dba
查看>>
visualvm
查看>>
docker(4):coreos+docker+rancher真厉害
查看>>
设计模式之代理模式,学习笔记
查看>>
在Qsys中创建用户自定义IP
查看>>
【leetcode】Container With Most Water
查看>>
Python -- machine learning, neural network -- PyBrain 机器学习 神经网络
查看>>
一道dp题目
查看>>
mysql中间件研究(tddl atlas cobar sharding-jdbc)
查看>>
Cast-128 加密算法和 MyPassWord 的破解
查看>>
4.28下午 听力611
查看>>
ActiveMQ学习笔记(1)----初识ActiveMQ
查看>>
Java与算法之(2) - 快速排序
查看>>
Windows之IOCP
查看>>
机器学习降维之主成分分析
查看>>
CTP2交易所成交回报
查看>>
WebSocket & websockets
查看>>
《机器学习实战》学习笔记第二章 —— K-近邻算法
查看>>
uni-app 引入本地iconfont的正确姿势以及阿里图标引入
查看>>
DSB
查看>>