[英]How can i put textview inside edittext
在 WhatsApp 中,當您回復消息時,它會顯示如下:
我嘗試了更多次,但我無法像 WhatsApp 使用的那樣設計布局。
您只需要在EditText視圖上方擴充您想要回復的文本。我的 xml 代碼如下
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/rl_resend_root_img"
android:visibility="visible"
android:padding="5dp"
android:background="@drawable/background">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Name"
android:id="@+id/tv_resend_name"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_resend_name"
android:text=" Photo"
android:visibility="visible"
android:id="@+id/resend_no_cmnt"
android:gravity="center"
android:drawableLeft="@drawable/camera"
android:layout_marginTop="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_resend_name"
android:text="what a pic brooo.."
android:maxLines="1"
android:textSize="14sp"
android:visibility="gone"
android:id="@+id/resend_cmnt_data"
android:gravity="center"
android:layout_marginTop="5dp" />
<FrameLayout
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentEnd="true">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/resend_image"
android:src="@drawable/henna"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|end"
android:background="@drawable/background"
android:id="@+id/resend_clear_img"
android:src="@drawable/clear"/>
</FrameLayout>
</RelativeLayout>
快樂編碼
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.