Comments (3)
第一次item还没有生成吧 高亮的view是null的 具体查下你的逻辑吧
from highlight-guideview.
你好,我调试了一下发现第一次请求网络并给listview设置adapter,我发现convertView不是空的,但是就是不显示,能帮忙看下问题所在么?
`
DockingScanEntity entity = JsonUtils.fromJsonToObj(success.getMsg(), DockingScanEntity.class);
if (entity != null) {
for (int i = 0; i < list.size(); i++) {
if (list.get(i).getBarcode().equals(entity.getBarcode())) {
toast("已扫描过该条码");
return;
}
}
if (entity.getStyle().equals("2")) {
strongCount++;
}
list.add(0, entity);
adapter = new DockingScanAdapter(DockingScanAty.this, list, access, DockingScanAty.this,
guideView);
mListView.setAdapter(adapter);
confirmCount++;
count();
}
`
`
@Override
public View getView(int position, View convertView, final ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = LayoutInflater.from(context).inflate(R.layout.lv_item_docking_scan, parent, false);
holder.barcode = (TextView) convertView.findViewById(R.id.item_tv_barcode);
holder.goodsName = (TextView) convertView.findViewById(R.id.item_tv_goodsName);
holder.songSta = (TextView) convertView.findViewById(R.id.item_tv_songSta);
holder.tips = (TextView) convertView.findViewById(R.id.item_tv_tips);
holder.checkBox = (CheckBox) convertView.findViewById(R.id.item_cb);
holder.goodsMark = (TextView) convertView.findViewById(R.id.item_tv_scanGoodsMark);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
DockingScanEntity entity = getData(position);
if (entity != null) {
holder.barcode.setText(entity.getBarcode());
if (!entity.getNum().equals("1.00")) {
holder.goodsName.setText("商品:" + entity.getGoods() + "(" + entity.getNum() + "平方)");
} else {
holder.goodsName.setText("商品:" + entity.getGoods());
}
if (ValueUtils.isStrNotEmpty(entity.getGoodinfo())) {
holder.goodsMark.setText("备注:" + entity.getGoodinfo());
holder.goodsMark.setVisibility(View.VISIBLE);
} else {
holder.goodsMark.setVisibility(View.GONE);
}
holder.songSta.setText("送件网点:" + entity.getSong_serverid());
if (ValueUtils.isStrNotEmpty(entity.getStyle())) {
if (entity.getStyle().equals("2")) {// 强装显示tips
holder.tips.setVisibility(View.VISIBLE);
} else {
holder.tips.setVisibility(View.GONE);
}
}
holder.checkBox.setChecked(isSelected.get(position));
LogUtils.i("position--->>>" + position);
LogUtils.i("convertView--->>>" + convertView);
if (position == 0) {
guideView.setHighLightView(convertView);
}
}
final View view = convertView;
final int p = position;
final int change = holder.checkBox.getId();
holder.checkBox.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
clickListener.onClick(view, parent, p, change);
}
});
return convertView;
}
private class ViewHolder {
TextView barcode;
TextView goodsName;
TextView songSta;
TextView tips;
CheckBox checkBox;
TextView goodsMark;
}`
from highlight-guideview.
DockingScanEntity entity = getData(position); 没联网获取数据前 你这个entitiy有值吗 可以调试下
from highlight-guideview.
Related Issues (12)
- 新增 点击区域消失 我可以提交吗 HOT 4
- 提示文字修改 HOT 2
- 为什么会出现两个高亮区域 HOT 1
- 高亮的地方想点击如何处理呢 HOT 1
- 小问题 HOT 3
- 重复使用问题 HOT 1
- 无法下载compile 'com.zhl.cbpullrefresh:CBPullRefreshLibrary:1.0.0' HOT 1
- demo 中的小bug HOT 1
- 一个小bug
- 东西很不错 但是没有实际运用不太友好 HOT 1
- 一个小问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from highlight-guideview.