我正在尝试创建一些文本的聊天泡泡。为此,我创建了三个Layoutouts,主线性布局内部我使用FramLayout,我设置了9个补丁背景对于此Framlayout在Framlayout的内部,我添加了一个RelativeLayout,在这里我放置了三个textView和一个imageView.but输入了长文本,它超出了FramLayout边界。我不知道我做错了什么或者我什么都没有。当我我使用小文本它仍然适合,但与大文本,它甚至从FramLayout的背景边框出去。附件我正在显示我的泡沫和雅虎即时消息泡泡。我试图创建像雅虎一样但有一些不同style.Please给我你的建议。我尝试了很多不同的方式,但没有成功。提前感谢。 。 在这里,我把我Layoutfile在Android中创建一个聊天泡泡
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/linearListLayout1">
<FrameLayout
android:id="@+id/frameLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/bubbleblue" >
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minHeight="100dp">
<TextView
android:id="@+id/chattitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"/>
<TextView android:id="@+id/chatdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"/>
<TextView android:id="@+id/chatText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/chatstatus"
android:layout_below="@+id/chattitle"
android:layout_toLeftOf="@+id/chatstatus"
android:text="TextView" />
<ImageView
android:id="@+id/chatstatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/add_picture"
android:layout_alignParentRight="true"
android:layout_below="@+id/chatdate"
android:minHeight="2dip"
android:maxWidth="2sp"
android:maxHeight="2sp"
android:layout_marginRight="2dp"/>
</RelativeLayout>
</FrameLayout>
那么我们需要看到布局文件。我对这种事情偏爱Linear/RelativeLayouts。 FrameLayouts可以得到一个多毛的国际海事组织。 – Phix 2012-02-22 17:15:42
你是否尝试过填充? – jmcdale 2012-02-22 17:18:03
是的,我也使用填充,并使用余量。 – aftab 2012-02-22 17:23:55