First of all i have a relativeLayout (body_view), and i'm putting a
scrollView (viScroll) inside:
viScroll = new ScrollView( App.app );
viScroll.setVisibility(View.VISIBLE );
viScroll.setGravity(Gravity.CENTER);
RelativeLayout.LayoutParams rlp = new
RelativeLayout.LayoutParams(getDisplayWidth() ,
RelativeLayout.LayoutParams.FILL_PARENT );
body_view.addView(viScroll , rlp );
Now i'm creating a ButtonContainer relativeLayout wich must have some
button views inside:
RelativeLayout.LayoutParams rlp2 = new RelativeLayout.LayoutParams( menu_width
, RelativeLayout.LayoutParams.FILL_PARENT );
rlp2.setMargins(menu_left, 0, 0 , 0 );
buttonContainer = new RelativeLayout( App.app );
buttonContainer.setGravity(Gravity.CENTER);
viScroll.addView(buttonContainer,rlp2);
Now i put the buttons inside the ButtonContainer:
for( int i = 0 ; i < nOptions ; i ++ ){
buttons[i] = new ElementButton( App.app );
buttons[i].addToViewAtEnd( buttonContainer );
}
public void addToViewAtEnd( RelativeLayout layout ){
RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(
width , RelativeLayout.LayoutParams.WRAP_CONTENT );
int child_count = layout.getChildCount();
int last_id = child_count > 0 ?
layout.getChildAt(child_count-1).getId() : 0;
rlp.addRule( RelativeLayout.BELOW , last_id );
layout.addView( view , rlp );
}
The problem is that my buttonContainer is not being displayed on the center
of the viScroll scrollView. If the main layout BodyView haves low height
then the buttonContainer is not displayed... something is going wrong and i
can't find it.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en