Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Edit: After running a small local test, I think the issue may be that the TextViews you have in each row are in front of the ListView row view. Try setting the model.entry and model.score background colors. /Edit</p> <p>I think it's coming from the convertViews being reused. Try moving this:</p> <pre><code>if (position == 6 || position == 7) { row.setBackgroundColor(R.color.black); } </code></pre> <p>Outside of the if (row == null) block, and change it to this:</p> <pre><code>if (position == 6 || position == 7) { model.entry.setBackgroundColor(R.color.black); model.score.setBackgroundColor(R.color.black); } else { model.entry.setBackgroundColor(/*Whatever your default background color is*/); model.score.setBackgroundColor(/*Whatever your default background color is*/); } </code></pre> <p>So your full getView method would be:</p> <pre><code> @Override public View getView(int position, View convertView, ViewGroup parent) { View row = convertView; RowModelViews model; if (row == null) { LayoutInflater inflater = LayoutInflater.from(GamePlayerActivity.this); row = inflater.inflate(R.layout.game_line_layout, null); model = new RowModelViews(row); model.entry = (TextView) row.findViewById(R.id.gameLineEntry); model.score = (TextView) row.findViewById(R.id.gameLineEntryScore); row.setTag(model); } else { model = (RowModelViews) row.getTag(); } if (position == 6 || position == 7) { model.entry.setBackgroundColor(R.color.black); model.score.setBackgroundColor(R.color.black); } else { model.entry.setBackgroundColor(/*Whatever your default background color is*/); model.score.setBackgroundColor(/*Whatever your default background color is*/); } model.entry.setText(objects.get(position).entry); model.score.setText(objects.get(position).score); return row; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload