Câu hỏi

Các cách thiết kế style trong ứng dụng React Native?

entry
Ẩn câu trả lời detail

Dùng thuộc tính style

Bạn có thể thêm style vào component của mình bằng cách sử dụng các thuộc tính style. Bạn chỉ cần thêm các thuộc tính style vào phần tử của mình và nó chấp nhận một đối tượng thuộc tính.

```jsx import React, {Component} from 'react'; import {Platform, StyleSheet, Text, View} from 'react-native';

export default class App extends Component { render() { return ( <View style={{flex:1,justifyContent:"center",backgroundColor:"#fff", alignItems:"center"}}> <View style={{width:200,height:150,backgroundColor:"red",padding:10}}> <Text style={{fontSize:20, color:"#666"}}>Styled with style props ...

Bạn cần đăng nhập để xem

Gợi ý câu hỏi khác

Props Drilling là gì?

Xem câu trả lời detail

Các component cốt lõi trong React Native?

Xem câu trả lời detail

Cách ứng dụng React Native làm việc mượt mà với animation?

Xem câu trả lời detail

setNativeProps là gì?

Xem câu trả lời detail

Bảo mật mạng và SSL Pinning là gì?

Xem câu trả lời detail