Hi,
I have used RelativeLayout for a custom implementation of a ListAdapter and I am not sure if I can continue using this or if I need to use TableLayout.
In the first example I have the text positioned as I would like by using one image view and one text view containing the book name and the author name. However, I want to style the author text differently so I think I will need two text views.
In the second example I have added another text view but it floats to the right. Second eg is Clipboard02.png.
How can I make the second text view go under the first text (as in eg 1). I have done this in code rather than using XML layout.
http://carriehall.co.uk/Clipboard01.png
LinearLayout.LayoutParams skyParams = new LinearLayout.LayoutParams( 70,
LayoutParams.WRAP_CONTENT );
ImageView skyControl = new ImageView( context );
skyControl.setImageResource( R.drawable.the_eyre_affair );
addView( skyControl, skyParams );
LinearLayout.LayoutParams bookParams = new LinearLayout.LayoutParams( LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT);
bookParams.setMargins( 5, 10, 5, 10 );
TextView bookControl = new TextView( context );
bookControl.setTextAppearance( context, R.style.SpecialText );
bookControl.setText( book.getTitle( ) + "\n\n" + book.getAuthor( ));
addView( bookControl, bookParams );