0
私はチャットバブルを作ります。私は9patchイメージを使ってバブルを作りました。しかし、私はtextviewのサイズに応じてバブルのサイズを変更したい..どのようにそれを行うには?チャイルドテキストビューのサイズに応じて背景9パッチ画像のサイズを変更するには
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:background="@drawable/senderbubble2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true">
<TextView
android:id="@+id/txt_msg"
android:text="hello world"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:textColor="#000000" />
</LinearLayout>
</RelativeLayout>
上記は、チャットバブルの私のXMLコードである...
のマニュアルを参照してください。 – Noorul
私は試しましたが、動作していません@Ahamed – Droid
あなたのコードを編集しますか? – Noorul