Android Flexbox 不使用 textview 文本调整宽度如何解决?

问题描述

这是我的 XML 代码

  <com.google.android.flexBox.FlexBoxLayout
                    xmlns:android="http://schemas.android.com/apk/res/android"
                    xmlns:app="http://schemas.android.com/apk/res-auto"
                    android:id="@+id/mainBottom1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:flexWrap="wrap"
                    app:alignItems="stretch"
                    app:alignContent="stretch"
                    >

                <TextView
                    style="@style/statusTextList"
                    android:id="@+id/cardStatusText"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:hint=" Label0"
                    android:text="hi"
                    android:textColorHint="@color/ColorLightGray"
                    android:visibility="visible"


                    />


                <TextView
                    android:layout_toRightOf="@+id/cardStatusText"
                    style="@style/statusTextList"
                    android:id="@+id/cardStatusDetails"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:hint=" Label1"
                    android:textColorHint="@color/ColorLightGray"
                    />
              

                <TextView
                
                    style="@style/statusTextList"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/cardStatusTimeTextmain"
                    android:hint=" Label2"
                    android:textColorHint="@color/ColorLightGray"
                    android:visibility="visible"
                    />
                <TextView
                   
                    style="@style/statusTextList"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/cardStatusPlatformText"
                    android:hint=" Label3"
                    android:textColorHint="@color/ColorLightGray"
                    android:visibility="visible"
                    />

                </com.google.android.flexBox.FlexBoxLayout>

我以某种方式发现 flexBox 正在根据 TextView 的“提示”而不是内容文本来调整宽度。是否有任何方法可以覆盖它或任何其他选项来解决它?

注意:找到了一个补丁,每当为 textview 分配内容时,我都会以编程方式将提示设置为空值。

如果可用,还需要其他一些解决方案。谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)