<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:background="#f1f1f1"
android:layout_width="match_parent"
android:layout_height="match_parent">
</ListView>
<LinearLayout
android:padding="10dp"
android:gravity="center"
android:weightSum="1"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<EditText
android:paddingBottom="3dp"
android:layout_marginRight="10dp"
android:layout_weight=".70"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@drawable/lgbg"
android:hint="Add item" />
<ImageView
android:layout_gravity="center"
android:foregroundGravity="center"
android:padding="13dp"
android:background="@drawable/send"
android:layout_weight=".30"
android:layout_width="70dp"
android:layout_height="50dp"
android:src="@drawable/ic_send_white" />
</LinearLayout>
我認爲這將是非常複雜的(如果可能的話),這樣做的形狀。創建這個背景會更容易[9-patch PNG](https://developer.android.com/guide/topics/resources/drawable-resource.html#NinePatch)。 –
你可以手動繪製這個圖片作爲一個自定義的Drawable,但是如果有人把它作爲背景圖像(在Photoshop或其他)中,你可以將它設置爲EditText的背景,這可能會容易得多。 – NoChinDeluxe
9-patch可以做到這一點,在ilustrator或其他圖像編輯器中創建具有邊框和右上角的圖像編輯器,並使用Android Studio創建9-patch – Adonys