如何在 flexbox 中居中“TextView”?

0 xml android android-flexboxlayout

我尝试在 FlexboxLayout 中居中文本。我使用这个库 com.google.android:flexbox:0.2.5。我在列中有几个文本。我尝试了很多方法将它们放在该列的中间,但没有成功。

<com.google.android.flexbox.FlexboxLayout
            xmlns:app="http://schemas.android.com/apk/res-auto"
            style="?metaButtonBarStyle"
            android:layout_width="77dp"
            android:layout_height="match_parent"
            android:background="@drawable/bg_pattern_dark_bitmap"
            android:orientation="vertical"
            android:alpha="1"
            app:flexWrap="wrap"
            app:justifyContent="space_between"
            >

        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="lol"
                />
        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="lol"
                />
        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="lol"
                />
    </com.google.android.flexbox.FlexboxLayout>
Run Code Online (Sandbox Code Playgroud)

感谢您的任何帮助

Muh*_*uri 5

使用app:justifyContent="space_evenly"代替space_between