I am creating a ListView dynamically and want to add two TextViews in a single ListItem (one Below the other). If I add both TextView they are overlapping each other (The reason I m adding two TextView is because both have to have different text size and styles.)
here is the code… inside the custom ListAdapter getView Method
FrameLayout v = new FrameLayout(AppStarter.this);
TextView title = new TextView(AppStarter.this);
TextView date = new TextView(AppStarter.this);
title.setTextSize(16);
title.setTypeface(Typeface.DEFAULT, Typeface.BOLD);
title.setText(values[position]);
date.setText("Date : " + AppStarter.this.date[position]);
date.setTextSize(14);
v.addView(title);
v.addView(date, 1);
return v;
both title and date are overlapping each other I even tried addView(date,1);it didnt workout.
Either use LinearLayout or RelativeLayout.
pass the layout in adapter of listview.
or Add RelativeLayout and place views relatively on same