gpt4 book ai didi

android - 膨胀类 com.elyeproj.loaderviewlibrary.LoaderImageViewImageView 时出错

转载 作者:行者123 更新时间:2023-12-02 17:06:57 24 4
gpt4 key购买 nike

错误跟踪:

FATAL EXCEPTION: main Process: com.example.user.itekit, PID: 23028 android.view.InflateException: Binary XML file line #87: Error inflating class com.elyeproj.loaderviewlibrary.LoaderImageViewImageView at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) at android.view.LayoutInflater.rInflate(LayoutInflater.java:813) at android.view.LayoutInflater.rInflate(LayoutInflater.java:821) at android.view.LayoutInflater.inflate(LayoutInflater.java:511) at android.view.LayoutInflater.inflate(LayoutInflater.java:415) at android.view.LayoutInflater.inflate(LayoutInflater.java:366) at com.example.user.itekit.ListbaseAdapter.getView(ListbaseAdapter.java:74) at android.widget.AbsListView.obtainView(AbsListView.java:2842) at android.widget.ListView.measureHeightOfChildren(ListView.java:1290) at android.widget.ListView.onMeasure(ListView.java:1202) at com.example.user.itekit.ExpandableHightListView.onMeasure(ExpandableHightListView.java:36) at android.view.View.measure(View.java:18425) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1835) at android.widget.LinearLayout.measureVertical(LinearLayout.java:725) at android.widget.LinearLayout.onMeasure(LinearLayout.java:616) at android.view.View.measure(View.java:18425) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802) at android.widget.FrameLayout.onMeasure(FrameLayout.java:430) at android.view.View.measure(View.java:18425) at android.widget.ScrollView.measureChildWithMargins(ScrollView.java:2015) at android.widget.FrameLayout.onMeasure(FrameLayout.java:430) at android.widget.ScrollView.onMeasure(ScrollView.java:484) at android.view.View.measure(View.java:18425) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:728) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:464) at android.view.View.measure(View.java:18425) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802) at android.widget.FrameLayout.onMeasure(FrameLayout.java:430) at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:135) at android.view.View.measure(View.java:18425) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1835) at android.widget.LinearLayout.measureVertical(LinearLayout.java:725) at android.widget.LinearLayout.onMeasure(LinearLayout.java:616) at android.view.View.measure(View.java:18425) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802) at android.widget.FrameLayout.onMeasure(FrameLayout.java:430) at android.view.View.measure(View.java:18425) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1835) at android.widget.LinearLayout.measureVertical(LinearLayout.java:725) at android.widget.LinearLayout.onMeasure(LinearLayout.java:616) at android.view.View.measure(View.java:18425) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5802) at android.widget.FrameLayout.onMeasure(FrameLayout.java:430) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2881) at android.view.View.measure(View.java:18425) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2237) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1295) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1537) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1180) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6558) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777) at android.view.Choreographer.doCallbacks(Choreographer.java:590) at android.view.Choreographer.doFrame(Choreographer.java:560) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763) at android.os.Handler.handleCallback

尝试使用 https://android-arsenal.com/details/1/4243#!description 中的 android 加载程序 View .

理想的情况是:当链接显示到我的图像和文本时具有加载效果。

问题来了,每当我尝试通过适配器实现它时,我都会收到标题所述的错误

代码 fragment 如下:

@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)是否有任何替代的加载器 View 可以通过适配器轻松实现?

最佳答案

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

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

您在 xml LoaderImageViewImageView 中调用了某些内容,而不是 LoaderImageView

关于android - 膨胀类 com.elyeproj.loaderviewlibrary.LoaderImageViewImageView 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40949461/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com