Isonjululwe: phendula icandelo lemveli embindini osezantsi

Ingxaki enkulu kukuba icandelo lemveli elisabelayo kumbindi osezantsi alifikeleleki lula.

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>

Yintoni iYoga kwiReact Native

I-React Native liqonga lokwakha ii-apps eziphathwayo ngeReact. I-Yoga lulwimi lwenkqubo olunceda abaphuhlisi benze ujongano lomsebenzisi kunye nokusetyenziswa.

Yintoni iFlexbox

?

I-Flexbox yimodyuli yoyilo yeReact Native eyenza kube lula ukuyila uyilo oluguquguqukayo noluphendulayo. Ikuvumela ukuba uchaze ukuba ngawaphi amacandelo afanele ukunwenwa kwaye kufuneka acinezelwe, kwaye ibonelela ngeendlela ezahlukeneyo zokulawula indlela okwenziwa ngayo ubeko.

Izithuba ezihambelanayo:

Shiya Comment