2011년 4월 2일 토요일

[TIP] Table Layout 의 Width 균일하게 설정...

결론만 정리하면 Key 는

android:layout_width="0dip"  와 android:layout_weight="1" 였음..

설정 예제는..

    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"   
        android:layout_width="fill_parent"   
        android:layout_height="fill_parent" 
        android:paddingBottom="5px"
        android:gravity="bottom"
        android:stretchColumns="0,1"
        >
        <TableRow>
          <ImageButton
            android:id="@+id/n11"
            android:layout_column="0"
            android:layout_width="0dip"   
            android:layout_height="38dip"
            android:scaleType="fitXY" 
            android:layout_weight="1"
            android:background="#ffffff"
            android:src="@drawable/plusbtn"
          />

적용하니.. 원하는대로 버튼의 가로 크기가 균일하게 나옴.. ^^

댓글 없음:

댓글 쓰기