2012-02-22 7 views
9

チャットバブルをテキストで作成しようとしています。これは3つのレイアウトを作成しています。メインの線形レイアウトの内側に私はFramLayoutを使用しています.9パッチバックグラウンドを設定しています。 。Framlayoutの内側に、私は3つのtextViewsと1つのimageView.but型の長いテキストを配置しているところで、もう1つRelativeLayoutを追加しています.FrameLayout境界の外に出ます。私は何が間違っているのか、何が欠けているのか分かりません。小さなテキストを使用していますが、大文字でもFramLayout.In添付ファイルのバックグラウンドボーダーから外に出ます。私は自分のバブルとヤフーIMバブルを表示しています.Yahooのように同じスタイルを作成しようとしていますが、あなたの提案。私はさまざまな方法で多くを試みるが、成功を収めない。事前に感謝している。 。あなたの.9patch画像を作成する場合はenter image description here ここで私は私のLayoutfileAndroidでチャットバブルを作成する

 <?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> 

+0

レイアウトファイルを確認する必要があります。私はこのようなことのために線形/相対的なレイアウトの一部です。 FrameLayoutsは毛深いIMOを得ることができます。 – Phix

+0

あなたはパディングをするのをやってみましたか? – jmcdale

+0

はい私はまた、パッディングでそれを試して、マージンも使用します。 – aftab

答えて

4

を置いています、あなたはまた、あなたが左に定義コンテンツ領域、および下のピクセルを指定する必要があります。ルートレイアウト項目の背景についてCheck out this.

+0

こんにちは9パッチのために私はあなたのlink.http://developer.android.comで与えられたものと同じことをやります/guide/developing/tools/draw9patch.html – aftab

+0

@ user717572ページが見つかりません。 –

0

使用 enter image description hereenter image description here

イメージを右クリックしてを保存してください。ターゲットをとして保存してください。

+0

このリンクは質問に答えるかもしれませんが、答えの本質的な部分をここに含めて参考にしてください。リンクされたページが変更された場合、リンクのみの回答は無効になります。 - [レビューから](/レビュー/低品質の投稿/ 16876375) – MikeT

関連する問題