Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In the end I did it like this:<br/> <br/></p> <pre><code>TextView tvID = new TextView(this); tvID.setLayoutParams(new TableRow.LayoutParams(w_id, TableRow.LayoutParams.WRAP_CONTENT)); tvID.setPadding(5, 0, 0, 0); tvID.setTextSize(11); tvID.setText(sharedIDArt); artikliVrstica.addView(tvID); </code></pre> <p><br/></p> <pre><code>TextView tvNazArt = new TextView(this); TableRow.LayoutParams tvNazArtParms = new TableRow.LayoutParams(w_naz, TableRow.LayoutParams.WRAP_CONTENT, 0.4f); tvNazArtParms.setMargins(5, 0, 0, 0); tvNazArt.setLayoutParams(tvNazArtParms); tvNazArt.setTextAppearance(this, android.R.style.TextAppearance_Large); tvNazArt.setText(NazivArt); artikliVrstica.addView(tvNazArt); </code></pre> <p><br/></p> <pre><code>TextView tvKol = new TextView(this); TableRow.LayoutParams tvKolParms = new TableRow.LayoutParams(w_kol, TableRow.LayoutParams.WRAP_CONTENT, 0.3f); tvKolParms.setMargins(5, 0, 0, 0); tvKol.setLayoutParams(tvKolParms); tvKol.setTextAppearance(this, android.R.style.TextAppearance_Large); tvKol.setGravity(Gravity.RIGHT); tvKol.setText(kolicina); artikliVrstica.addView(tvKol); </code></pre> <p><br/></p> <pre><code>TextView tvCena = new TextView(this); TableRow.LayoutParams tvCenaParms = new TableRow.LayoutParams(w_cen, TableRow.LayoutParams.WRAP_CONTENT, 0.3f); tvCenaParms.setMargins(5, 0, 10, 0); tvCena.setLayoutParams(tvCenaParms); tvCena.setTextAppearance(this, android.R.style.TextAppearance_Large); tvCena.setGravity(Gravity.RIGHT); tvCena.setText(cena); artikliVrstica.addView(tvCena); </code></pre> <p><br/></p> <pre><code>TextView tvIzbris = new TextView(this); TableRow.LayoutParams tvIzbrParms = new TableRow.LayoutParams((w_izb-10), TableRow.LayoutParams.WRAP_CONTENT); tvIzbrParms.setMargins(10, 0, 5, 0); tvIzbris.setLayoutParams(tvIzbrParms); tvIzbris.setPadding(0, 7, 10, 7); tvIzbris.setTextAppearance(this, android.R.style.TextAppearance_Large); tvIzbris.setTypeface(null,Typeface.BOLD); tvIzbris.setTextColor(Color.BLACK); tvIzbris.setBackgroundColor(Color.WHITE); tvIzbris.setGravity(Gravity.CENTER); tvIzbris.setText("-"); artikliVrstica.addView(tvIzbris); </code></pre> <p><br/> In the "w_*" variabiles is stored the size of the "table header cels"...</p>
 

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