为了账号安全,请及时绑定邮箱和手机立即绑定

ViewGroup.LayoutParams layoutParams = holder.length.getLayoutParams(); layoutParams.width = mixWidth + (maxWidth/60f * getItem(position).time);

如题ViewGroup.LayoutParams layoutParams = holder.length.getLayoutParams();
layoutParams.width = mixWidth + (maxWidth/60f * getItem(position).time);   最后的time无法获取怎么回事呢

正在回答

1 回答

@Override

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

ViewHolder viewHolder = new ViewHolder();

if(convertView == null)

{

convertView = mLayoutInflater.inflate(R.layout.item_recorder, parent, false);

viewHolder.seconds = (TextView) convertView.findViewById(R.id.id_recorder_time);

viewHolder.length = convertView.findViewById(R.id.id_recorder_length);

convertView.setTag(viewHolder);

}

else

{

viewHolder = (ViewHolder) convertView.getTag();

}

viewHolder.seconds.setText(Math.round(getItem(position).time)+"\"");

ViewGroup.LayoutParams layoutParams = viewHolder.length.getLayoutParams();

layoutParams.width = (int) (mMinItemWidth+(mMaxItemWidth/60f*getItem(position).time));

return convertView;

}


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Android-仿微信语音聊天
  • 参与学习       43200    人
  • 解答问题       220    个

结合自定义View和API,Dialog管理等实现实现微信语音

进入课程

ViewGroup.LayoutParams layoutParams = holder.length.getLayoutParams(); layoutParams.width = mixWidth + (maxWidth/60f * getItem(position).time);

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信