Gelöst: native Komponente unten in der Mitte reagieren

Das Hauptproblem besteht darin, dass die reaktive native Komponente in der unteren Mitte nicht leicht zugänglich ist.

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>

Was ist Yoga in React Native

React Native ist eine Plattform zum Erstellen mobiler Apps mit React. Yoga ist eine Programmiersprache, die Entwicklern hilft, Benutzeroberflächen und Anwendungen zu erstellen.

Was ist Flexbox

?

Flexbox ist ein Layoutmodul für React Native, das es einfach macht, flexible und responsive Layouts zu erstellen. Sie können damit angeben, welche Komponenten gestreckt und welche komprimiert werden sollen, und es bietet eine Vielzahl von Optionen zur Steuerung der Darstellung des Layouts.

Zusammenhängende Posts:

Hinterlasse einen Kommentar