La xaliyay: ka falceli qaybta hooyo ee xarunta hoose

Dhibaatada ugu weyni waxay tahay in qaybta asalka ah ee ka falcelinaysa xarunta hoose aan si fudud loo heli karin.

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>

Waa maxay Yoga ee Dhaladka React

React Native waa madal lagu dhiso abka mobaylka ee leh React. Yoga waa luuqad barnaamijeed oo ka caawisa horumariyayaasha inay abuuraan is dhexgal isticmaale iyo codsiyo.

Waa maxay Flexbox

?

Flexbox waa qaabka qaabaynta ee React Native kaas oo sahlaya in la abuuro qaabab dabacsan oo jawaab leh. Waxay kuu ogolaaneysaa inaad qeexdo qaybaha ay tahay in la fidiyo iyo kuwa la isku cadaadiyo, waxayna ku siinaysaa fursado kala duwan oo lagu xakameynayo qaabka qaabka loo sameeyay.

Related posts:

Leave a Comment