类com.elyeproj.loaderviewlibrary.LoaderImageViewImageView

时间:2016-12-03 15:36:05

标签: android baseadapter loader

错误追踪:

  

致命的例外:主要                                                                            处理:com.example.user.itekit,PID:23028                                                                            android.view.InflateException:二进制XML文件行#87:错误   膨胀班   com.elyeproj.loaderviewlibrary.LoaderImageViewImageView                                                                                在   android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)                                                                                在android.view.LayoutInflater.rInflate(LayoutInflater.java:813)                                                                                在android.view.LayoutInflater.rInflate(LayoutInflater.java:821)                                                                                在android.view.LayoutInflater.inflate(LayoutInflater.java:511)                                                                                在android.view.LayoutInflater.inflate(LayoutInflater.java:415)                                                                                在android.view.LayoutInflater.inflate(LayoutInflater.java:366)                                                                                在   com.example.user.itekit.ListbaseAdapter.getView(ListbaseAdapter.java:74)                                                                                在android.widget.AbsListView.obtainView(AbsListView.java:2842)                                                                                在android.widget.ListView.measureHeightOfChildren(ListView.java:1290)                                                                                在android.widget.ListView.onMeasure(ListView.java:1202)                                                                                在   com.example.user.itekit.ExpandableHightListView.onMeasure(ExpandableHightListView.java:36)                                                                                在android.view.View.measure(View.java:18425)                                                                                在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802)                                                                                在   android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1835)                                                                                在android.widget.LinearLayout.measureVertical(LinearLayout.java:725)                                                                                在android.widget.LinearLayout.onMeasure(LinearLayout.java:616)                                                                                在android.view.View.measure(View.java:18425)                                                                                在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802)                                                                                在android.widget.FrameLayout.onMeasure(FrameLayout.java:430)                                                                                在android.view.View.measure(View.java:18425)                                                                                在   android.widget.ScrollView.measureChildWithMargins(ScrollView.java:2015)                                                                                在android.widget.FrameLayout.onMeasure(FrameLayout.java:430)                                                                                在android.widget.ScrollView.onMeasure(ScrollView.java:484)                                                                                在android.view.View.measure(View.java:18425)                                                                                在   android.widget.RelativeLayout.measureChildHorizo​​ntal(RelativeLayout.java:728)                                                                                在android.widget.RelativeLayout.onMeasure(RelativeLayout.java:464)                                                                                在android.view.View.measure(View.java:18425)                                                                                在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802)                                                                                在android.widget.FrameLayout.onMeasure(FrameLayout.java:430)                                                                                在   android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135)                                                                                在android.view.View.measure(View.java:18425)                                                                                在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802)                                                                                在   android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1835)                                                                                在android.widget.LinearLayout.measureVertical(LinearLayout.java:725)                                                                                在android.widget.LinearLayout.onMeasure(LinearLayout.java:616)                                                                                在android.view.View.measure(View.java:18425)                                                                                在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802)                                                                                在android.widget.FrameLayout.onMeasure(FrameLayout.java:430)                                                                                在android.view.View.measure(View.java:18425)                                                                                在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802)                                                                                在   android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1835)                                                                                在android.widget.LinearLayout.measureVertical(LinearLayout.java:725)                                                                                在android.widget.LinearLayout.onMeasure(LinearLayout.java:616)                                                                                在android.view.View.measure(View.java:18425)                                                                                在android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802)                                                                                在android.widget.FrameLayout.onMeasure(FrameLayout.java:430)                                                                                在   com.android.internal.policy.impl.PhoneWindow $ DecorView.onMeasure(PhoneWindow.java:2881)                                                                                在android.view.View.measure(View.java:18425)                                                                                在android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2237)                                                                                在android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1295)                                                                                在android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1537)                                                                                在android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1180)                                                                                在   android.view.ViewRootImpl $ TraversalRunnable.run(ViewRootImpl.java:6558)                                                                                在   android.view.Choreographer $ CallbackRecord.run(Choreographer.java:777)                                                                                在android.view.Choreographer.doCallbacks(Choreographer.java:590)                                                                                在android.view.Choreographer.doFrame(Choreographer.java:560)                                                                                在   android.view.Choreographer $ FrameDisplayEventReceiver.run(Choreographer.java:763)                                                                             在android.os.Handler.handleCallback

尝试使用https://android-arsenal.com/details/1/4243#!description中的Loader View for android。

理想的情况是:具有加载效果,因为链接显示给我的图像&观看文字。

问题是每当我尝试通过适配器实现它时,我会根据标题状态

得到错误

代码片段如下:

@Override
public View getView(int position, View convertView, ViewGroup parent) {

    ViewHolder viewHolder = null;

    if (convertView == null) {
        LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
        convertView = layoutInflater.inflate(R.layout.list, null);

        viewHolder = new ViewHolder();


        viewHolder.image = (LoaderImageView)convertView.findViewById(R.id.image);
        viewHolder.title = (LoaderTextView)convertView.findViewById(R.id.title);
        viewHolder.subtitle = (LoaderTextView)convertView.findViewById(R.id.subtitle);
        viewHolder.shop = (LoaderTextView)convertView.findViewById(R.id.shop);

        convertView.setTag(viewHolder);




    }else {

        viewHolder = (ViewHolder)convertView.getTag();
    }


    BeanclassTourCategory bean = (BeanclassTourCategory)getItem(position);

    Picasso.with(context)
            .load(bean.getImage())
            .fit()
            .into(viewHolder.image);

    viewHolder.title.setText(bean.getTitle());
    viewHolder.subtitle.setText(bean.getSubtitle());
    viewHolder.shop.setText(bean.getShop());

    return convertView;
}

A)是否有可能解决此错误?

B)是否可以使用适配器轻松实现任何替代Loader视图?

1 个答案:

答案 0 :(得分:0)

删除xml

中组件LoaderImageViewImageView的src