requestLayout()不正确地调用android.widget.RelativeLayout机器人 [英] requestLayout() improperly called by android.widget.RelativeLayout android
本文介绍了requestLayout()不正确地调用android.widget.RelativeLayout机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经显示列表视图时,它呈现出以下交战如何reslove它实现的列表视图customadapter。
requestLayout()不正确地调用android.widget.RelativeLayout {b42acc20 VE .... ...... ID为0,-52-480,0#7f0700ec应用:ID / ptr_id_header}布局过程:运行第二布局传递
Java的code
公开查看getView(INT位置,查看convertView,父母的ViewGroup)
{
查看查看= convertView;
如果(查看== NULL)
{
LayoutInflater VI =(LayoutInflater)的getContext()getSystemService(Context.LAYOUT_INFLATER_SERVICE)。
鉴于= vi.inflate(R.layout.listitemrow,NULL);
}
的RSSItem的RSSItem = mRssItemList.get(位置);
如果(的RSSItem!= NULL)
{
TextView的标题=(TextView中)view.findViewById(R.id.rowtitle);
如果(标题!= NULL)
{
title.setText(rssItem.getTitle());
}
}
返回查看;
}
解决方案
是RelativeLayout的布局,你是膨胀?如果是的话,尝试改变行
查看= vi.inflate(R.layout.listitemrow,NULL);
本
查看= vi.inflate(R.layout.listitemrow,父母,假);
i have implemented listview customadapter when displaying listview it showing below warring how to reslove it .
requestLayout() improperly called by android.widget.RelativeLayout{b42acc20 V.E..... ......ID 0,-52-480,0 #7f0700ec app:id/ptr_id_header} during layout: running second layout pass
java code
public View getView(int position, View convertView, ViewGroup parent)
{
View view = convertView;
if (view == null)
{
LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = vi.inflate(R.layout.listitemrow, null);
}
RssItem rssItem = mRssItemList.get(position);
if (rssItem != null)
{
TextView title = (TextView) view.findViewById(R.id.rowtitle);
if (title != null)
{
title.setText(rssItem.getTitle());
}
}
return view;
}
解决方案
Is RelativeLayout a layout, you are inflating? If it is, then try to change line
view = vi.inflate(R.layout.listitemrow, null);
to this
view = vi.inflate(R.layout.listitemrow, parent, false);
这篇关于requestLayout()不正确地调用android.widget.RelativeLayout机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文