Yakagadziriswa: react native component pazasi centre

Dambudziko guru nderekuti react native component pazasi centre haisvikike nyore.

I'm trying to create a component at the bottom center of the screen in React Native. I've tried using <code>absolute</code> and <code>relative</code> positioning, but nothing seems to work. Here's my code:
<code>&lt;View style={{position: 'absolute', bottom: 0, alignItems: 'center'}}&gt;
  &lt;Text&gt;This is my component!&lt;/Text&gt;
&lt;/View&gt;
</code>


A:

You can use <code>flexDirection:'row'</code>,<code>justifyContent:'center'</code>,<code>alignItems:'flex-end'</code>. 

<View style={{flexDirection:'row',justifyContent:'center',alignItems:'flex-end'}}>
<Text>This is my component!</Text>
</View>

Chii chinonzi Yoga muReact Native

React Native ipuratifomu yekuvaka nharembozha neReact. Yoga mutauro wekugadzira uyo unobatsira vanogadzira kugadzira mushandisi interface uye maapplication.

Chii chinonzi Flexbox

?

Flexbox idhizaini module yeReact Native inoita kuti zvive nyore kugadzira inoshanduka uye inopindura marongero. Inokubvumira kuti utaure kuti ndezvipi zvikamu zvinofanirwa kutambanudzwa uye izvo zvinofanirwa kudzvanywa, uye inopa dzakasiyana siyana sarudzo dzekudzora kuti marongerwo anoitwa sei.

Related posts:

Leave a Comment