ဖြေရှင်းထားသည်- အောက်ခြေဗဟိုရှိ မူလအစိတ်အပိုင်းကို တုံ့ပြန်ပါ။

အဓိကပြဿနာမှာ အောက်ခြေဗဟိုရှိ ဓာတ်ပြုမှုဆိုင်ရာ အစိတ်အပိုင်းကို အလွယ်တကူ မရနိုင်သောကြောင့် ဖြစ်သည်။

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 တွင် Yoga ဆိုတာဘာလဲ

React Native သည် React ဖြင့် မိုဘိုင်းအက်ပ်များကို တည်ဆောက်ရန်အတွက် ပလပ်ဖောင်းတစ်ခုဖြစ်သည်။ Yoga သည် developer များအား user interface နှင့် applications များဖန်တီးရာတွင် ကူညီပေးသော ပရိုဂရမ်ဘာသာစကားတစ်ခုဖြစ်သည်။

Flexbox ဆိုတာဘာလဲ

?

Flexbox သည် ပြောင်းလွယ်ပြင်လွယ်နှင့် တုံ့ပြန်မှုရှိသော အပြင်အဆင်များကို ဖန်တီးရန် လွယ်ကူစေသည့် React Native အတွက် layout module တစ်ခုဖြစ်သည်။ ၎င်းသည် သင့်အား မည်သည့်အစိတ်အပိုင်းများကို ဆွဲဆန့်သင့်ပြီး မည်သည့်အရာကို ချုံ့သင့်သည်ကို သတ်မှတ်နိုင်စေကာ ၎င်းသည် layout ကို မည်သို့ပြန်ဆိုသည်ကို ထိန်းချုပ်ရန်အတွက် ရွေးချယ်စရာအမျိုးမျိုးကို ပေးဆောင်သည်။

Related ရေးသားချက်များ:

a Comment ချန်ထား