I'm a super noob. With that in mind, I'm trying to set the individual cells of a gridview to different colours. I know this question has been asked many times and I've read most of them. I have seen many different ways of doing this but the simplest (I believe) was to @Override the getView method with:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = super.getView(position, convertView, parent);
int color = 0x00FFFFFF; // Transparent
if (SOME_CONDITION) {
color = 0xFF0000FF; // Opaque Blue
}
view.setBackgroundColor(color);
return view;
}
The problem is that in the 3rd line, super.getview I get "can't resolve method". If I remove the "super" it does resolve but then says the Override does not actually override the superclass method, which makes sense but can someone please explain why the original code does not work.
Thanks
0 comments:
Post a Comment