हल: नीचे के केंद्र में मूल घटक पर प्रतिक्रिया करें

मुख्य समस्या यह है कि निचले केंद्र में प्रतिक्रिया मूल घटक आसानी से सुलभ नहीं है।

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>

रिएक्ट नेटिव में योग क्या है

रिएक्ट नेटिव, रिएक्ट के साथ मोबाइल ऐप बनाने का एक मंच है। योग एक प्रोग्रामिंग लैंग्वेज है जो डेवलपर्स को यूजर इंटरफेस और एप्लिकेशन बनाने में मदद करती है।

फ्लेक्सबॉक्स क्या है

?

फ्लेक्सबॉक्स रिएक्ट नेटिव के लिए एक लेआउट मॉड्यूल है जो लचीला और उत्तरदायी लेआउट बनाना आसान बनाता है। यह आपको यह निर्दिष्ट करने की अनुमति देता है कि किन घटकों को बढ़ाया जाना चाहिए और किसे संकुचित किया जाना चाहिए, और यह लेआउट को कैसे प्रस्तुत किया जाता है, इसे नियंत्रित करने के लिए कई प्रकार के विकल्प प्रदान करता है।

संबंधित पोस्ट:

एक टिप्पणी छोड़ दो