I am trying to change gridView column number. I call setNumColumn() and invalidateViews() to update the view.
However, the grid\'s cell width w
Problem Solved:
The child view in the grid view do not re-calculate its layout when the grid view changes the column on runtime.
In your BaseAdapter, you should call forceLayout() to calculate its layout.
@Override
public View getView(final int position, View convertView,
ViewGroup parent) {
if (null == convertView) {
convertView = mInflater.inflate(
R.layout.mnm_customer_user_thumbnail, null);
control.txtUserName = (TextView) convertView
.findViewById(R.id.mnmTxtStudentName);
control.image = (ImageView) convertView
.findViewById(R.id.mnmImageStudent);
control.imageCheckBox = (ImageView) convertView
.findViewById(R.id.mnmImageCheckBox);
control.mnmOuterBounder = (RelativeLayout) convertView
.findViewById(R.id.mnmOuterBound);
convertView.setTag(control);
} else {
convertView.forceLayout();
}
...
...
...
...
Thanks