gridView适配

来源:互联网 发布:linux上部署jenkins 编辑:程序博客网 时间:2024/05/21 15:45
public YellowPageAdapter(Context mContext, List<HashMap<String, Object>> list) {
super();
this.mContext = mContext;
this.list = list;
WindowManager windouwManager=(WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
windth=windouwManager.getDefaultDisplay().getWidth()/2;

}




convertView=LayoutInflater.from(mContext).inflate(R.layout.enterprise_yellow_page_item, null);
holder.yellow_page_item_img=(ImageView) convertView.findViewById(R.id.yellow_page_item_img);
holder.yellow_page_item_word=(TextView) convertView.findViewById(R.id.yellow_page_item_word);
RelativeLayout.LayoutParams layoutParams= (RelativeLayout.LayoutParams) holder.yellow_page_item_img.getLayoutParams();
layoutParams.width=windth;
layoutParams.height=windth;
holder.yellow_page_item_img.setLayoutParams(layoutParams);

0 0
原创粉丝点击