I am trying to set layout_width to FILL_PARENT to an image view. I am using following code::
ImageView image = new ImageView(mContext);
image.setImageResource(R.drawable.my_ac_line);
LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
image.setLayoutParams(lp);
layout.addView(image);
But its not working.
Can any please suggest me the answer for it.
Thanks in advance.
You might be importing LayoutParams
instead it try
Hope it will help you.