0

TextViewのAndroidLayoutParamsに問題があります。200 dip x200dipのサイズのボックスにテキストを表示したい。しかし、何も表示されていません。これはコードです:

tr = new TableRow(this);
TextView phone = new TextView(this);
phone.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
phone.setLines(20);
phone.setText(Html.fromHtml("<b>Beschreibung</b><br /><br />"));
phone.append(poi.getDescription());
tr.addView(phone,new ViewGroup.LayoutParams(calculatePxs(200),calculatePxs(200)));
        tr.setPadding(10, 15, 10, 15);

v = new View(this);
v.setBackgroundColor(Color.rgb(51, 51, 51));

table.addView(tr,new TableLayout.LayoutParams(
                LayoutParams.WRAP_CONTENT,
                LayoutParams.WRAP_CONTENT));

table.addView(v,new TableLayout.LayoutParams(
                LayoutParams.WRAP_CONTENT,
                1));
4

1 に答える 1

0

それ以外の

new ViewGroup.LayoutParams(calculatePxs(200),calculatePxs(200)));
    tr.setPadding(10, 15, 10, 15);

TableRow.LayoutParamsを使用

お気に入り :

new TableRow.LayoutParams(calculatePxs(200),calculatePxs(200)));
tr.setPadding(10, 15, 10, 15);
于 2012-09-19T09:37:25.557 に答える