私はチャットルーム用のスピーチバブルを作成しようとしています。各スピーチバブルには添付されたxmlレイアウトがあります。AndroidのImageViewがGingerBreadの下のFrameLayout内のmatch_parentと一致しません
私はmatch_parentとframe_layoutにwrap_contentにのTextViewにwrap_content、吹き出しImageViewのを設定することでこれを実現しています。テキストの背後にあるspeech_bubbleイメージは、テキストの量に応じて縮尺が変わります。はバブルです。
私は親とwrap_contentする高さに合わせるのTextViewに幅を設定し、いくつかの理由で、それは、アイスクリームサンドイッチ(アンドロイド4.1)に必要に応じて完全にに動作します。 しかしジンジャーブレッド内側の画像ビューの泡はと一致しません。テキストは泡の中にきれいに収まります。 ジンジャーブレッドでは、内面画像の表示は、テキストに関係なく常にの同じサイズのままで、のテキストの外にはのテキストがあふれています。 でframeLayoutがwrap_contentに展開されていても、それがすることになっているよう 、ImageViewのはないmatch_parentを行います。
これはなぜ起こっているのですか? xmlを使って設定できる別のパラメータがありますか、これを修正するためにプログラムで呼び出せるメソッドはありますか?
ありがとうございます! ICSで
正しい動作:ジンジャーブレッドで
誤った行動: Incorrect Behavior in GingerBread
XMLレイアウト:その様子から
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/speech_bubble_framelayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/color_transparent"
android:layout_toRightOf="@id/message_user_imageView">
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/message_background_imageview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:scaleType="fitXY"
android:layout_centerInParent="true"
android:textColor="@color/color_brown_mud"
android:background="@drawable/chat_bubble_flipped"
/>
<TextView
android:id="@+id/message_textView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:maxEms="10"
android:background="@color/color_transparent"
android:textColor="@color/color_brown_uiDesign_pallete"
android:textSize="15sp"
android:textStyle="bold"
android:gravity="center_horizontal"
android:text="Message"
android:padding="5dp"
android:layout_marginLeft="25dp"
android:layout_marginRight="20dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
/>
</FrameLayout>
</merge>
問題を修正しました。 alignBottomとalignRightをいくつかのパディングに使用しました。ありがとうございました! – Bala