我在 ViewPager 的 fragment 内有一个 ExpandableListView。
问题在于组项目被水平切成两半,如下图所示。
我在应用程序的其他地方有相同的 ExpandableListView 代码,但在 Activity 内部,它工作正常吗?
组项目的 XML 布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:orientation="vertical"
>
<TextView
android:id="@+id/lbl_exercise_group"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
android:textSize="20dp"
android:textColor="@color/white"
android:background="@color/material_blue_500"
/>
</LinearLayout>
最佳答案
我认为 TextView 中的layout_with 对于完整尺寸应该是 match_parent。
关于java - Fragment+ViewPager 内的 ExpandableListView groupItem 水平切掉一半的项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32811395/