2015-08-21 133 views
-2

AutocompleteTextView第一線我要添加namespace..but它給我的錯誤一樣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> 
+0

,但它告訴我添加的命名空間,然後自定義類的名字,我沒有,但它給人的錯誤..「標籤未關閉」。 –

+0

首先所有這些都確保您的XML已經過適當的驗證元素或空格,但它也沒有匹配的引號數。 – openshac

+0

thanx解決方案..這個建議爲我工作.. –

回答

0

確保您的XML是經過適當驗證的元素或空間,並且必須具有匹配的引號數量。

0

我刪除類並保持AutocompleteTextView,因爲它是在OnCreate中(),我用的方法......它的正常工作....這些方法..,

auto1.setOnFocusChangeListener(新景觀。 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定製AutoCompleteTextView

的對象