0
This is my xml!
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="top" >
<TextView
android:id="@+id/tvTituloRelatorio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="@string/new_tarefa"
android:textSize="40dp"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
<ScrollView
android:id="@+id/scrollItens"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/rlItens"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center" >
</RelativeLayout>
</ScrollView>
Via Java, I need to insert TextViews
inside one of these RelativeLayouts
and that does not overlap one another!
public class RelatorioTarefas extends Activity{
TextView titulo;
RelativeLayout rl;
ScrollView sr;
int[] cores = new int[]{R.color.azul, R.color.darkRed, R.color.goldenRoud, R.color.orange, R.color.seaGreen};
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.relatorio);
Intent receive = getIntent();
String title = receive.getStringExtra("TITULO");
String[] pessoa = receive.getStringExtra("PESSOA").split(new EditarIncluirTarefas().SEP);
String[] tarefa = receive.getStringExtra("TAREFA").split(new EditarIncluirTarefas().SEP);
rl = (RelativeLayout) findViewById(R.id.rlItens);
sr = (ScrollView) findViewById(R.id.scrollItens);
titulo = (TextView) findViewById(R.id.tvTituloRelatorio);
titulo.setText(title);
for(int i = 0; i < pessoa.length; i++)
{
TextView t = new TextView(this);
t.setText(pessoa[i].toString());
rl.addView(t);
}
}
}
Clarify your specific issue or add other details to highlight exactly what you need. The way it’s written here, it’s hard to know exactly what you’re asking. See the How to Ask page for help clarifying this question.
– Joannis
more than this edition is impossible to specify @Joannis
– César Alves
I swear I don’t understand what you want to do
– Joannis
What’s missing is the java code you’ve tried.
– ramaral
my insertion happens in for(){} @Joannis
– César Alves
What is unclear in this question?
– ramaral
It worked here with the explanation of Nato! Vlw bro!
– César Alves