안드로이드 개발 질문/답변
(글 수 45,052)
LinearLayout 안에 TextView 에 Dialog Theme 를 적용하고 싶습니다.
LinearLayout 안에 TextView 를 아래와 같이 배치했는데요
보기에 너무 썰렁해 각각의 LinearLayout 을 Dialog 처럼 꾸며주고 싶습니다.
위와 같은 Dialog 형식이 각각의 박스모양이 되어서 Tilte - Content 를 대체하는 식입니다.
하나의 Tilte-Content 는 아래와 같이 LinearLayout 안에 두 개의 TextView 로 되어 있는데요
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/distance_title" />
<TextView
android:id="@+id/distance"
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textScaleX="1.3"
android:textSize="40sp"
android:text="Content" />
</LinearLayout>
1. 가장 간단한건 Theme 를 적용하는 거라 생각했는데,
LinearLayout 이나 TextView 에 Theme.Dialog 를 추가해도 아무런 변화가 없더군요.
Theme 는 Activity 나 Application 에 적용하는걸로 되어 있더라구요.
2. TextView 에 drawableTop, drawableLeft, drawableBottom, drawableRight 에 SDK 에 들어있는
popup_left_dark.png 와 같은 png 파일을 적용해봤는데, 사이즈가 자동으로 늘어나지 않더군요.
그 말은 이미지를 표시할 박스에 맞춰 미리 각각 만들어야 하는건데, 이건 아닌거 같구요.
3. LinearLayout 에는 drawableTop 같은 속성이 적용되지 않더라구요
그래서 LinearLayout 에 background 로 popup_full_dark.png 파일 종류를 적용해봤는데,
역시 사이즈가 자동으로 늘어나지 않더군요.
생각하는 최종은 Dialog 박스 세개가 배치되어 있는 식입니다.
그렇지만 Dialog 처럼 Parent 가 비활성화 된다거나 하는 것은 없이, 디자인만 빌려쓰고 싶습니다.
이런 디자인을 해주려면 어떻게 해야 할까요~?
LinearLayout 안에 TextView 를 아래와 같이 배치했는데요
보기에 너무 썰렁해 각각의 LinearLayout 을 Dialog 처럼 꾸며주고 싶습니다.
위와 같은 Dialog 형식이 각각의 박스모양이 되어서 Tilte - Content 를 대체하는 식입니다.
하나의 Tilte-Content 는 아래와 같이 LinearLayout 안에 두 개의 TextView 로 되어 있는데요
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/distance_title" />
<TextView
android:id="@+id/distance"
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textScaleX="1.3"
android:textSize="40sp"
android:text="Content" />
</LinearLayout>
1. 가장 간단한건 Theme 를 적용하는 거라 생각했는데,
LinearLayout 이나 TextView 에 Theme.Dialog 를 추가해도 아무런 변화가 없더군요.
Theme 는 Activity 나 Application 에 적용하는걸로 되어 있더라구요.
2. TextView 에 drawableTop, drawableLeft, drawableBottom, drawableRight 에 SDK 에 들어있는
popup_left_dark.png 와 같은 png 파일을 적용해봤는데, 사이즈가 자동으로 늘어나지 않더군요.
그 말은 이미지를 표시할 박스에 맞춰 미리 각각 만들어야 하는건데, 이건 아닌거 같구요.
3. LinearLayout 에는 drawableTop 같은 속성이 적용되지 않더라구요
그래서 LinearLayout 에 background 로 popup_full_dark.png 파일 종류를 적용해봤는데,
역시 사이즈가 자동으로 늘어나지 않더군요.
생각하는 최종은 Dialog 박스 세개가 배치되어 있는 식입니다.
그렇지만 Dialog 처럼 Parent 가 비활성화 된다거나 하는 것은 없이, 디자인만 빌려쓰고 싶습니다.
이런 디자인을 해주려면 어떻게 해야 할까요~?
2. ImageView처럼 쉽게 제어할 수 있는 편리한 방법은 없습니다. Drawable자체에서 처리해야할것 같네요
3. drawableTop은 TextView에만 적용되는 속성입니다.
그냥 배경 이미지등을 가져다가 참고해서 그대로 배치해서 사용하세요 관련된 비트맵등은 SDK밑의 platform/android-1.5/data/res 에 전부 있습니다. 레리아웃 파일들도 다 있구요.