2012-11-25 2 views
0

사용자 정의 UI가 포함 된 확장형 목록보기가 있습니다. BaseExpandableListAdapter에서 확장 된 어댑터를 정의했습니다. 내 groupviews 정확히 25dp 높이가되고 싶어요,하지만 그들이 높은확장형 목록보기 맞춤 그룹 뷰가 높음

내 XML은`이다

`

<TextView 
    android:id="@+id/product_name" 
    android:layout_width="0dp" 
    android:layout_height="25dp" 
    android:layout_weight="2" 
    android:gravity="center_vertical" 
    android:paddingLeft="15dp" 
    android:text="@string/products" 
    android:textSize="12sp" 
    android:textStyle="bold" /> 

<TextView 
    android:layout_width="0dp" 
    android:layout_height="25dp" 
    android:layout_marginLeft="25dp" 
    android:layout_weight="1" 
    android:gravity="center" 
    android:text="@string/weight_g" 
    android:textSize="12sp" 
    android:textStyle="bold" /> 

<TextView 
    android:layout_width="0dp" 
    android:layout_height="25dp" 
    android:layout_weight="1.6" 
    android:gravity="center" 
    android:text="@string/measure" 
    android:textSize="12sp" 
    android:textStyle="bold" /> 
내 코드는

@Override 
    public View getGroupView(final int groupPosition, 
      final boolean isExpanded, final View convertView, 
      final ViewGroup parent) { 
     final View view = View.inflate(context, 
       R.layout.header_measurements, null); 

     final TextView title = (TextView) view 
       .findViewById(R.id.product_name); 
     title.setText(data.get(groupPosition).categoryName); 

     return view; 
    } 

답변

0

당신은 가장 왼쪽으로 중요한 부분. XML에서 텍스트 뷰의 컨테이너 (LinearLayout 또는 RelativeLayout 등)의 내용은 무엇입니까? 레이아웃 높이는 android:layout_height="25dp" 또는 android:layout_height="wrap_content"

중 하나 여야합니다.