最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - React native layout fixed width and stretch remaining space - Stack Overflow

programmeradmin3浏览0评论

How can I make something like this in react-native ?

In the right I want a component that has a fixed width, and in the left taking all the remaining space another component.

How can I make something like this in react-native ?

In the right I want a component that has a fixed width, and in the left taking all the remaining space another component.

Share Improve this question asked May 5, 2017 at 11:34 adi.neagadi.neag 6432 gold badges12 silver badges27 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 21

Try this:

  <View style={{flex: 1, flexDirection: 'row'}}>
    <View style={{
      backgroundColor: 'blue',
      flexGrow: 1,
    }}>
      <Text>Fluid</Text>
    </View>
    <View style={{
      backgroundColor: 'red',
      width: 100,
    }}>
      <Text>Fixed</Text>        
    </View>
  </View>
发布评论

评论列表(0)

  1. 暂无评论