1
我想调整AutoCompleteTextView的过滤器选项,因为它无法识别之间的空格。这就是为什么我创建了一个类调用MyAutoCompleteView:自定义控件:错误膨胀类
package my.house;
public class MyAutoCompleteView
extends
android.widget.AutoCompleteTextView
{
public MyAutoCompleteView (android.content.Context context)
{
super (context);
}
public MyAutoCompleteView(android.content.Context context, android.util.AttributeSet attrs)
{
super(context, attrs);
}
public MyAutoCompleteView(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
{
super(context, attrs, defStyle);
}
}
为了测试这个事情,我改变了我的布局XML来:
<my.house.MyAutoCompleteView
android:id='@+id/search'
android:layout_height='wrap_content'
android:layout_width='fill_parent'
android:singleLine='true'
></my.house.MyAutoCompleteView>
我膨胀的布局文件,因为我使用的片段。
这里的onCreateView方法在我的片段:
@Override
public android.view.View onCreateView (
final android.view.LayoutInflater inflater,
final android.view.ViewGroup container,
final android.os.Bundle savedInstanceState)
{
return inflater.inflate (my.house.R.layout.myfragment, container, false);
}
不幸的是我收到此错误信息:
android.view.InflateException:二进制XML文件行#17:错误充气类my.house.MyAutoCompleteView
任何想法可能是什么问题?谢谢!
从my.house.MyAutoCompleteView中删除'xmlns:android ='http:// schemas.android.com/apk/res/android'' – 2012-04-26 13:18:22
感谢您的评论!我删除了这一行 - 没有改变。仍然:“错误膨胀类” – Marco 2012-04-26 13:25:46