હલ: તળિયે કેન્દ્રમાં મૂળ ઘટક પર પ્રતિક્રિયા આપો

મુખ્ય સમસ્યા એ છે કે તળિયે કેન્દ્રમાં પ્રતિક્રિયા મૂળ ઘટક સરળતાથી સુલભ નથી.

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>

રીએક્ટ નેટીવમાં યોગ શું છે

React Native એ React વડે મોબાઇલ એપ બનાવવાનું પ્લેટફોર્મ છે. યોગા એ એક પ્રોગ્રામિંગ ભાષા છે જે વિકાસકર્તાઓને યુઝર ઇન્ટરફેસ અને એપ્લિકેશન બનાવવામાં મદદ કરે છે.

ફ્લેક્સબોક્સ શું છે

?

Flexbox એ રીએક્ટ નેટિવ માટેનું લેઆઉટ મોડ્યુલ છે જે લવચીક અને રિસ્પોન્સિવ લેઆઉટ બનાવવાનું સરળ બનાવે છે. તે તમને સ્પષ્ટ કરવા દે છે કે કયા ઘટકોને ખેંચવા જોઈએ અને કયા સંકુચિત કરવા જોઈએ, અને તે લેઆઉટને કેવી રીતે રેન્ડર કરવામાં આવે છે તે નિયંત્રિત કરવા માટે વિવિધ વિકલ્પો પ્રદાન કરે છે.

સંબંધિત પોસ્ટ્સ:

પ્રતિક્રિયા આપો