我有一個linearLayout有一些自動完成和文本框。我想在linearlayout中插入一個形狀(矩形)。我怎樣才能做到這一點。我是Android新手。將形狀添加到LinearLayout Android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:id="@+id/layout">
<AutoCompleteTextView android:id="@+id/autocompleteCountry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/CONTRY_LABEL"
/>
<AutoCompleteTextView android:id="@+id/locationAutoCompleteFrom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/from"
android:visibility="gone"
/>
<AutoCompleteTextView android:id="@+id/locationAutoCompleteTO"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/to"
android:visibility="gone"
/>
<!-- <Button android:id="@+id/buttonRoute"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/buttonRouteText"
android:enabled="false"
android:clickable="true"
/>
-->
去動態的矩形佈局,檢查此http: //www.gadgetsaint.com/tips/dynamic-square-rectangular-layouts-android/#.WRRjMvl96H s – ASP 2017-05-11 13:15:52