[android-developers] How to get LayoutParams after inflating the view
I have following code in my Adapter's getView(...) function
{
if ( convertView == null) {
view = LayoutInflater.from(getContext()).inflate(R.layout.program_item, null);
}
LayoutParams params = view.getLayoutParams();
}
params is always null.
Any idea what am doing wrong?
The intent is too change the width of the view based on the data (position) in adapter and keep the height as defined in the xml (program_item.xml).
-- You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home