안드로이드 개발 질문/답변
(글 수 45,052)
이미지 뷰에 버튼모양까지 있는 이미지를 표현하고 해당 이미지 뷰 버튼 부분을 누르면
다른 액티비티로 이동시키려고 합니다. 그래서 해당 이미지 버튼 부분에 투명 버튼을 하나
달아서 구현하려던 중 이미지뷰와 버튼을 겹쳐서 구현하려면 FrameLayout 을 사용하시길래
하기 XML처럼 구현하였으나 실행해보니 ListView는 보여지지 않네요
참고로 ListView는 row xml로 각행을 표현해주고 있습니다. 무엇이 문제일까요?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/LinearLayout01"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout
android:id="@+id/absoluteLayout"
android:layout_height="wrap_content"
android:layout_width="match_parent">
<ImageView
android:id="@+id/imageview"
android:layout_width="fill_parent"
android:src="@drawable/youtube"
android:layout_height="80px"/>
<Button android:text="Button"
android:id="@+id/button1"
android:layout_gravity="right"
android:background="#00000000" android:layout_height="match_parent" android:layout_width="56dp"></Button>
</FrameLayout>
<ListView
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="1dp"
android:divider="#00000000"/>
</LinearLayout>




framelayout의 높이를 match_parent로 잡아서 그렇습니다.
근데 굳이 framelayout 쓰셔야 될 이유가 있나요? imagebutton이라던지 button에 배경을 이미지로 줘도 되실텐데요;;