当前位置: 首页 > 知识库问答 >
问题:

inflating类com.elyeproj.LoaderViewLibrary.LoaderImageViewImageView时出错

司寇善
2023-03-14

错误跟踪:

致命异常:主进程:com.example.user.itekit,pid:23028 android.view.inflateException:二进制XML文件行#87:在android.view.layoutinflater.createViewFromTag(layoutinflater.java:764)在android.view.layoutinflater.rinflate(layoutinflater.java:813)在android.view.layoutinflater.rinflate(layoutinflater.java:821)在8425)在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)在ins(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.View.View.Measure(View.java:18802)在Android.Widget.LinearLayout.MeasuildWithMargins(yout.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)在k

尝试使用https://android-arsenal.com/details/1/4243#!description中的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)是否有任何可供选择的加载器视图可以用适配器轻松实现?

共有1个答案

汪文光
2023-03-14

很抱歉我没有第一次看到这个:

膨胀类com.elyeproj.LoaderViewLibrary.LoaderImageViewImageView时出错

您在xml中调用了LoaderImageViewImageView而不是LoaderImageView

 类似资料: