Zgjidhet: reagojnë komponentin vendas në qendër të poshtme

Problemi kryesor është se komponenti vendas i reaksionit në qendër të poshtme nuk është lehtësisht i aksesueshëm.

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>

Çfarë është Yoga në React Native

React Native është një platformë për ndërtimin e aplikacioneve celulare me React. Yoga është një gjuhë programimi që ndihmon zhvilluesit të krijojnë ndërfaqe përdoruesi dhe aplikacione.

Çfarë është Flexbox

?

Flexbox është një modul paraqitjeje për React Native që e bën të lehtë krijimin e paraqitjeve fleksibël dhe të përgjegjshëm. Kjo ju lejon të specifikoni se cilët komponentë duhet të shtrihen dhe cilët duhet të kompresohen, dhe ofron një shumëllojshmëri opsionesh për të kontrolluar se si paraqitet paraqitja.

Mesazhe të ngjashme:

Lini një koment