When I run the code below with

Button t = DynamicLayout.CreateButton(this, id++, 0xffffffff  /* text
color */, 20  /*  text size */, "Button", Gravity.CENTER,
res.getDrawable(R.drawable.spot_button), true);

and

// TextView t = DynamicLayout.CreateTextView(this, id++, 20 /*  text
size */, 0xffffffff /* text color */, 200 /* width */, 100 /* height
*/, "TextView", false);

commented out, I get 12 buttons displayed with text "Button". No
problem.

When I comment out the Button code and un-comment the TextView code, I
get nothing displayed.

I know there are some things missing here, but why does this work with
buttons and not with a TextView? The text color I am using is
0xffffffff and the background is dark, so I don't think the color is
the problem.

Anybody got any ideas?

===============================


   ...
      TableLayout table = DynamicLayout.CreateTableLayout(this, id++,
Gravity.CENTER|Gravity.TOP, fill, 150, false, false);
      top.addView(table);
      createMenus(table);
      return top;
   }

   private void createMenus(TableLayout table) {
        final Resources res = getResources();
        final int fill = LinearLayout.LayoutParams.FILL_PARENT;
        for (int menuIndex = 0; menuIndex < D.menus.getSize(); menuIndex+
+) {
           TableRow tr = DynamicLayout.CreateTableRow(this, id++,
Gravity.LEFT, fill, 50);
           for (int i = 0; i < 4; i++) {
                //Button t = DynamicLayout.CreateButton(this, id++,
0xffffffff, 20, "Button", Gravity.CENTER,
res.getDrawable(R.drawable.spot_button), true);
                TextView t = DynamicLayout.CreateTextView(this, id++, 20,
0xffffffff, 100, 50, "TextView", false);
                tr.addView(t);
            }
            table.addView(tr);
        }
   }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to