只有当条件满足抓取图片 [英] fetching images only if condition satisfy

查看:107
本文介绍了只有当条件满足抓取图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我显示许多图像用户但是,我需要一些条件的基础上获取图像,从绘制文件夹。对于EG-如果用户设置自己的性别为男,他应该只显示男性使用的产品图片


解决方案

 如果(条件)
  {
  。image_view.getResources()getDrawable(R.drawable.male_img);
  }

I am displaying many images to user But,I need to fetch images on the basis of some conditions,from the drawable folder. For Eg- if a user sets his gender to be "Male" he should be shown images of product used only by men

解决方案

  if(condition)
  {
  image_view.getResources().getDrawable(R.drawable.male_img);
  }

这篇关于只有当条件满足抓取图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆