안드로이드 개발 질문/답변
(글 수 45,052)
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.company.ggoggoma.ImageView
android:id="@+id/imageview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<ImageButton
android:id="@+id/Game01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dip"
android:layout_gravity="center"
android:background="@drawable/game01" />
<ImageButton
android:id="@+id/Game02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/game02" />
<ImageButton
android:id="@+id/Game03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/game03" />
<ImageButton
android:id="@+id/Game04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/game04" />
</LinearLayout>
</FrameLayout>
FrameLayout을 만들고... 그 안에 LinearLayout을 넣은 구조인데요....
에뮬레이터를 실행시키면 아랫부분에 검은색으로 1cm정도 남게됩니다.
이미지뷰로 다 채우려고 android:scaleType="fitXY" 이것도 집어넣었는데....
잘 안되네요... 왜그런지 알려주세요.. ㅠ.ㅜ
그리고요... 에뮬레이터를 HVGA해상도로 했을때는 적당히 잘 나왔는데... QVGA해상도로 만드니까...
화면은 작아졌는데 바탕화면과 이미지버튼은 크기가 그대로여서..
바탕화면이 짤리고, 이미지버튼도 아래부분에서는 짤려서 안나오네요...
이런거는 어떤식으로 맞춰주나요???
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.company.ggoggoma.ImageView
android:id="@+id/imageview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<ImageButton
android:id="@+id/Game01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dip"
android:layout_gravity="center"
android:background="@drawable/game01" />
<ImageButton
android:id="@+id/Game02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/game02" />
<ImageButton
android:id="@+id/Game03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/game03" />
<ImageButton
android:id="@+id/Game04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@drawable/game04" />
</LinearLayout>
</FrameLayout>
FrameLayout을 만들고... 그 안에 LinearLayout을 넣은 구조인데요....
에뮬레이터를 실행시키면 아랫부분에 검은색으로 1cm정도 남게됩니다.
이미지뷰로 다 채우려고 android:scaleType="fitXY" 이것도 집어넣었는데....
잘 안되네요... 왜그런지 알려주세요.. ㅠ.ㅜ
그리고요... 에뮬레이터를 HVGA해상도로 했을때는 적당히 잘 나왔는데... QVGA해상도로 만드니까...
화면은 작아졌는데 바탕화면과 이미지버튼은 크기가 그대로여서..
바탕화면이 짤리고, 이미지버튼도 아래부분에서는 짤려서 안나오네요...
이런거는 어떤식으로 맞춰주나요???
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.company.ggoggoma.ImageView
android:id="@+id/imageview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scaleType="fitXY"/>
윗 부분이 배경화면을 그림으로 채우시는 것이라면,
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
여기에서 백그라운드로 이미지를 지정하는 것은 어떨까요?
그리고 xmlns:android="http://schemas.android.com/apk/res/android" 는 최상위 레이아웃에만 적어주시면 됩니다.