Google 맵에 Map View balloon
을 구현하려고하지만 풍선의 레이아웃으로 차단합니다.
풍선의 크기는 콘텐츠 크기 여야하지만 크기가 커서 배경 drawable 크기가 필요합니다. 누군가 다른 사람이 제공 한 꽤 큰 풍선 9-patch image
을 가지고 있기 때문에 작은 풍선 내용이 모든 화면 (드로어 블 크기)을 차지합니다. 배경 drawable 대신 내용보기를 래핑하는 방법은 무엇입니까?
ImageView
SRC가
wrap_content
또는
fill_parent
로, 너무 드로어 블 크기를 가지고 있기 때문에하는
FrameLayout
같은 문제를 만들어 사용)는 더 정확한 답이 없다 . (빨간색 공간이 삭제 될 수 있습니다) 여기
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content" android:id="@+id/balloon_main_layout"
android:orientation="horizontal" android:clickable="true"
android:focusable="true" android:focusableInTouchMode="true"
android:layout_width="wrap_content" android:background="@drawable/info_bulle_selector">
<LinearLayout android:id="@+id/linearLayout1"
android:layout_height="wrap_content" android:layout_width="0dp"
android:layout_weight="1">
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content" android:text="TextView"
android:id="@+id/balloon_item_title" android:textColor="#ffffff"></TextView>
</LinearLayout>
<ImageView android:id="@+id/balloon_close"
android:layout_marginLeft="5dp" android:src="@drawable/fermer_selector"
android:scaleType="fitXY" android:layout_height="30dp"
android:layout_width="30dp"></ImageView>
</LinearLayout>
내가 무슨의 화면입니다 : 여기
내 레이아웃입니다
이 문제를 해결하기 위해 어떤 생각이있는 경우 (배경 이미지로 내 레이아웃을 디자인 할 때 종종 가지고있는), 그것은 좋을 것입니다.
미리 감사드립니다.
편집 : 여기
아홉 패치 PNG : 특히,
1) 풍선 9 패치 이미지를 축소합니다
예, 내가 너무 생각을 첫 번째 해결 방법이지만 일종의 트릭이기 때문에 일반적인 문제는 해결되지 않으므로 다른 해결책이 있는지 궁금합니다. 두 번째 해결 방법은 작은 삼각형 때문에 풍선에 적합하지 않습니다. 그러나 해결책을 수락하기 전에 다른 대답이있을 때까지 기다릴 것입니다. – Astrorvald
9 패치 이미지를 업로드 할 수 있습니까? – AZ13
나는 일하는 해결책으로 나의 대답을 편집했다. – AZ13