폰기종마다 화면크기가 다르잖아요
그걸 이제 함수로 조절가능하거나 하나요?
px로 조절하면 그값이 상대값이 아니라 절대값이라 화면이 큰 액정에는 작게 나오는거같은데
지금 일일이 px로 크기를 조정하지 않고
이미지 5개를 화면크기에 맞게 균등하게 표시할수있는 함수같은건 없을까요?
지금 짠 소스입니다
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageButton
android:id="@+id/ImageBtn01"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@drawable/white8" />
<ImageButton
android:id="@+id/ImageBtn02"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/ImageBtn01"
android:text="@drawable/white8" />
<ImageButton
android:id="@+id/ImageBtn03"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignTop="@+id/ImageBtn02"
android:layout_toRightOf="@+id/ImageBtn02"
android:text="@drawable/white8" />
<ImageButton
android:id="@+id/ImageBtn04"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignTop="@+id/ImageBtn03"
android:layout_toRightOf="@+id/ImageBtn03"
android:text="@drawable/white8" />
<ImageButton
android:id="@+id/ImageBtn05"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignTop="@+id/ImageBtn04"
android:layout_toRightOf="@+id/ImageBtn04"
android:text="@drawable/white8" />
</RelativeLayout>
layout_weight 와
weightSum 을 이용하시면 될겁니다. 구글링 해보세요!