<TableLayout
android:id="@+id/table"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<ImageView
android:id="@+id/img1"
android:layout_width="80px"
android:layout_height="80px"
android:src="@drawable/icon"
/>
<ImageView
android:id="@+id/img2"
android:layout_width="80px"
android:layout_height="80px"
android:src="@drawable/icon"
/>
</TableRow>
</TableLayout>
xml은 위와 같이 구성되어 있습니다.
TableLayout 은 LinerLayout으로 묶여 있구요.
TableLayout layout = (TableLayout)findViewById(R.id.table);
LayoutParams params = new LayoutParams(150, 150);
layout.setLayoutParams(params);
ImageView image = (ImageView) findViewById(R.id.img1);
ViewGroup.MarginLayoutParams margin = new ViewGroup.MarginLayoutParams(image.getLayoutParams());
margin.setMargins(20, 20, 20, 20);
image.setLayoutParams(layout );
위와 같은 방법으로 해도 컴파일조차 되질 않으니... ㅜ.ㅠ
어떻게 하면 될까요??