0

我有ExpandableListView一个CheckedTextView作为 grouprow 视图。但我需要减少组之间的间距,所以我把它放在一个LinearLayout. 从那时起,列表没有展开,只是对点击没有反应。有任何想法吗?代码如下

组行.xml

  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/holder"
android:clickable="true"
android:orientation="vertical">
<CheckedTextView 

android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-13dp"
android:layout_marginBottom="-13dp"
android:text="@string/hello_world"
android:paddingLeft="20dp"
android:textColor="#FFFFFF"
android:textSize="60sp"
android:includeFontPadding="false"
android:textStyle="bold" />
 </LinearLayout>

获取组视图:

       @Override
public View getGroupView(int groupPosition, boolean isExpanded,
        View convertView, ViewGroup parent) {
    if (convertView == null) {

        convertView = minflater.inflate(R.layout.grouprow, null);
    }
    LinearLayout holder = (LinearLayout) convertView;
    CheckedTextView txtGr = (CheckedTextView)    holder.findViewById(R.id.textView1);
    txtGr.setText(groupItem.get(groupPosition));
    txtGr.setChecked(isExpanded);
    font = Typeface.createFromAsset(activity.getAssets(),
            "uww.otf");
    txtGr.setTypeface(font);
    return convertView;
}
4

1 回答 1

0

通过将 theLinearLayout和 the设置CheckedTextView为不可点击来解决问题

于 2013-02-05T10:04:48.337 回答