安卓代码中设置ImageView属性

ImageView :iv

LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);  
lp.setMargins(10, 10, 10, 10);  
iv.setLayoutParams(lp);  

设置图片

iv.setImageDrawable(getResources().getDrawable(R.drawable.sdate1));

 

posted @ 2015-01-30 15:14  Xiao.T  阅读(1615)  评论(0编辑  收藏  举报