如何在Android中创建具有autolookup的表单

如何在Android中创建具有autolookup的表单,android,android-layout,Android,Android Layout,我想使用自动查找进行搜索。 我已经部分创建了这个布局。这是我的XML代码。 现在,我如何在这个应用程序中使用自动查找 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout

我想使用自动查找进行搜索。 我已经部分创建了这个布局。这是我的XML代码。 现在,我如何在这个应用程序中使用自动查找

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <LinearLayout
        android:id="@+id/imageView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="horizontal" >

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:src="@drawable/logo_demo" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/imageView1"
        android:layout_marginTop="10dp"
        android:background="@drawable/flight_bar"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/roundtripTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="23dp"
            android:layout_marginTop="5dp"
            android:layout_weight="0.01"
            android:text="Round trip"
            android:textColor="@android:color/white" />

        <TextView
            android:id="@+id/OneWayTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="23dp"
            android:layout_marginTop="5dp"
            android:layout_weight="0.01"
            android:text="OneWay"
            android:textColor="@android:color/white" />

        <TextView
            android:id="@+id/multicityTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="23dp"
            android:layout_marginTop="5dp"
            android:layout_weight="0.03"
            android:text="MultiCity"
            android:textColor="@android:color/white" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:id="@+id/linearLayout4"
        android:layout_height="wrap_content"
        android:layout_below="@+id/linearLayout1"
        android:background="@drawable/from2"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/fromTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dp"
            android:layout_marginTop="7dp"
            android:layout_weight=".05"
            android:text="From" />

        <TextView
            android:id="@+id/toTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dp"
            android:layout_marginTop="7dp"
            android:layout_weight=".05"
    android:text="To" />

    </LinearLayout>
</RelativeLayout>

我必须使用一个自动查找框,在下面要用Autoook和在中间都有图像。所以我已经做了从现在到现在,我不能创建分开的自动查找框。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:src="@drawable/ic_launcher" />

    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_below="@+id/imageView1"
        android:layout_marginTop="10dp"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/roundtripTextView"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginTop="5dp"
            android:layout_weight="1"
            android:background="#FF0000FF"
            android:gravity="center"
            android:text="Round trip"
            android:textColor="@android:color/white"
            android:textSize="20sp" />

        <TextView
            android:id="@+id/OneWayTextView"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="5dp"
            android:layout_weight="1"
            android:background="#FF0000FF"
            android:gravity="center"
            android:text="OneWay"
            android:textColor="@android:color/white"
            android:textSize="20sp" />

        <TextView
            android:id="@+id/multicityTextView"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="5dp"
            android:layout_weight="1"
            android:background="#FF0000FF"
            android:gravity="center"
            android:text="MultiCity"
            android:textColor="@android:color/white"
            android:textSize="20sp" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/linearLayout1"
        android:orientation="horizontal" >

        <LinearLayout
            android:id="@+id/linearLayout4"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="2"
            android:orientation="vertical" >

            <EditText
                android:id="@+id/fromTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="7dp"
                android:gravity="center_horizontal"
                android:hint="From" />

            <TextView
                android:id="@+id/textView1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:text="LON"
                android:textAppearance="?android:attr/textAppearanceLarge" />

            <TextView
                android:id="@+id/textView3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:text="London Great Britain"
                android:textAppearance="?android:attr/textAppearanceMedium" />
        </LinearLayout>

        <ImageView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:background="@android:color/darker_gray"
            android:src="@drawable/ic_launcher" />

        <LinearLayout
            android:id="@+id/linearLayout5"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="2"
            android:orientation="vertical" >

            <EditText
                android:id="@+id/toTextView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="7dp"
                android:gravity="center_horizontal"
                android:hint="To" />

            <TextView
                android:id="@+id/textView2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:text="DXB"
                android:textAppearance="?android:attr/textAppearanceLarge" />

            <TextView
                android:id="@+id/textView4"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:text="Dubai United Arab Emirates"
                android:textAppearance="?android:attr/textAppearanceMedium" />
        </LinearLayout>
    </LinearLayout>

</RelativeLayout>

编辑

在“从/到”布局之后放在布局下方



朋友,你认为我们是来完成你的项目的吗?为什么每次都有布局问题?你不想自己尝试任何事情。对不起,你应该试试自己。我们在这里帮助您解决错误或代码部分。每天你都有新的布局,你要求我们创建布局!!!非常糟糕,我的朋友。@ChintanRathod非常感谢你@我完全同意你…我们不是来完成任何人的project@Rahul,我不是反对任何事情,但除非你付出一些努力,否则我帮不了你。我已经发布了布局,这可能会帮助您解决您的问题。希望你不要误会我。我的意图不是要降低你的积极性。@ChintanRathod我非常感谢你给我展示了一些东西。正因为如此,我做了更多的事情,今天我付出了我的全部努力。我知道兄弟的意图,谢谢你。我必须使用自动查找“发件人”和“收件人”。所以我必须使用自动查找“发件人”和“收件人”下面的内容布局只需将
EditText
更改为
AutoCompleteTextView
。这很好。我想你没有mt问题@chintan@Rahul,请简要说明你想做什么?我已经更新了我的XMLCID,请参阅参考。As是我在下面的部分,我必须使用一个自动查找框,在下面,我必须使用Autoook,在这两个中间都会有图像。所以我已经做了,直到现在和现在我不能。创建以将下面的自动查找框从和分离到。使用我的代码并编辑它。谢谢
<LinearLayout
    android:id="@+id/linearLayout4"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_below="@+id/linear3"
    android:orientation="horizontal" >

    <AutoCompleteTextView
        android:id="@+id/textView1"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="2"
        android:gravity="bottom"
        android:text="LON" />

    <ImageView
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:background="@android:color/darker_gray"
        android:src="@drawable/ic_launcher" />

    <AutoCompleteTextView
        android:id="@+id/textView3"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="2"
        android:gravity="bottom"
        android:text="DXB" />
</LinearLayout>