Note that there are some explanatory texts on larger screens.

plurals
  1. POImageView does not show up when added to a TableRow programmatically
    primarykey
    data
    text
    <p>Here are the relevant code bits:</p> <pre><code>&lt;HorizontalScrollView android:id="@+id/cards_scrollview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:fillViewport="false" &gt; &lt;TableRow android:id="@+id/cards_container" android:layout_width="wrap_content" android:layout_height="100dp" &gt; &lt;ImageView android:id="@+id/test_card" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingRight="@dimen/cards_distance" android:adjustViewBounds="true" android:src="@drawable/card_back" /&gt; &lt;/TableRow&gt; &lt;/HorizontalScrollView&gt; </code></pre> <p>and</p> <pre><code>private void addCard(Drawable d) { TableRow container = (TableRow) findViewById(R.id.cards_container); ImageView card = new ImageView(this); card.setAdjustViewBounds(true); card.setPadding(R.dimen.zero, R.dimen.zero, R.dimen.cards_distance, R.dimen.zero); TableRow.LayoutParams params = new TableRow.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); card.setLayoutParams(params); card.setImageDrawable(d); card.setVisibility(View.VISIBLE); container.addView(card); } </code></pre> <p>I'm positively sure the Drawable I'm trying to add is not null, has the bounds properly set, the alpha set to 255, and fits properly. I've tested this by applying it to test_card instead of trying to add new ImageViews, which works perfectly.</p> <p>Is there anything I'm missing here?</p>
    singulars
    1. This table or related slice is empty.
    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