1
我想在我的應用程序中放置寬度爲4:6的兩個視圖,並在其中放置文本。React Native:修正查看寬度
import React, { Component } from 'react';
import { AppRegistry, View , Text} from 'react-native';
class FixedDimensionsBasics extends Component {
render() {
return (
<View style={{flex:1, flexDirection: "row"}}>
<View style={{flex:0.4, backgroundColor: 'powderblue'}}>
<Text>sfasdfadsfdasfas</Text>
</View>
<View style={{flex:0.6, backgroundColor: 'skyblue'}}>
<Text>sfasdfadsfdasfas</Text>
</View>
</View>
);
}
}
AppRegistry.registerComponent('AwesomeProject',() => FixedDimensionsBasics);
問:是否有一種方法來保持固定寬度和視圖使文字寬度調整?
謝謝!
p.s.我使用React Native Doc代碼示例&調試。
真棒,這就是我期待的... – Shongsu