2
I made the following code to insert Textviews in a Linearlayout already defined.
public void inserirLacunas(){
LinearLayout ll = (LinearLayout) findViewById(R.id.layoutLetras);
for(int i = 0; i < palavraCerta.length(); i++){
TextView lacuna = new TextView(this);
lacuna.setText("_");
lacuna.setTextSize(40);
ll.addView(lacuna);
}
}
My question is: how can I put one marginRight
in Textview gap, so that when the code is executed, do not take the Textviews very close to one another?
palavraCerta is another variable created previously in the code, which does not matter in this doubt
What should be the import for "Layoutparams"?
– Lucas Medeiros
Depends, it’s best to change to
LinearLayout.LayoutParams.WRAP_CONTENT
– ramaral