背景图像高度不会降低

时间:2015-01-08 07:10:21

标签: android relativelayout

我有一个聊天页面,其中每个聊天气泡都包含msg,msg时间,阅读状态等。所有这些都是文本视图,它位于相对布局中。该相对布局具有背景图像,该背景图像是聊天气泡图像。我的问题是,当消息内容较少时,聊天气泡高度不会变小。

 <RelativeLayout
        android:id="@+id/chatImageContainer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/chat_others"
        android:minWidth="150dp"
        android:padding="5dp" >

        <TextView
            android:id="@+id/msg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="10dp"
            android:text=""
            android:textSize="16sp" />


        <ImageView
            android:id="@+id/thumbnailView"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:layout_marginBottom="17dp"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:layout_marginTop="10dp"
            android:contentDescription="@null"
            android:visibility="gone" />

        <ProgressBar
            android:id="@+id/progressBar"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="17dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="10dp"
            android:max="100"
            android:minHeight="50dp"
            android:minWidth="50dp"
            android:progress="1"
            android:visibility="gone" />
    </RelativeLayout>

0 个答案:

没有答案
相关问题