标签未关闭

时间:2015-08-21 06:56:07

标签: xml

AutocompleteTextView的第一行,我想添加名称空间..但它给我一个错误,如tag name is not closed ...或告诉如何在这里添加名称空间..

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
           xmlns:tools="http://schemas.android.com/tools"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:paddingLeft="@dimen/activity_horizontal_margin"
           android:paddingRight="@dimen/activity_horizontal_margin"
           android:paddingTop="@dimen/activity_vertical_margin"
           android:paddingBottom="@dimen/activity_vertical_margin"
           tools:context="com.nxtstepzedu.nxtstepz.nxtstepz.S1Activity"
           android:orientation="vertical">

        <schemas.android.com/apk/res/android".InstantAutoComplete
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/atcatogory"
         android:textColor="#000000"
         android:hint="Search for gym etc..."/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="IN"
        android:textSize="25sp"
        android:layout_marginTop="20sp"/>

   <AutoCompleteTextView
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:id="@+id/atlocation"
     android:textColor="#000000"
     android:layout_marginTop="10sp"
     android:hint="Search for locations..." />

</LinearLayout>

2 个答案:

答案 0 :(得分:0)

确保您的XML经过适当验证,元素或空格并且必须具有匹配的引号数。

答案 1 :(得分:0)

我删除了那个类并保留了AutocompleteTextView,并且在OnCreate()中,我习惯了方法......它工作得很好....这些方法..,

auto1.setOnFocusChangeListener(new View.OnFocusChangeListener(){

        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if (hasFocus)
                auto1.showDropDown();

        }
    });

    auto1.setOnTouchListener(new View.OnTouchListener() {

        @Override
        public boolean onTouch(View v, MotionEvent event) {
            auto1.showDropDown();
            return false;
        }
    });

在主类中,auto1是AutoCompleteTextView的对象