Hello All,

I've spent several days trying to get LinearLayout and TableLayout to
work the way I want it to but no success yet. This is why I need your
help.

This is what I'm trying to do. I'm creating a GUI with a view on the
top portion, and a button and text field on the bottom. Simple enough
right? The view is just a class that extends the View object, which I
use to draw some graphics.
The problem is that the view takes up the entire display and the
button and drawing do not show up. This is some pseduo code of how I'm
doing it:

LinearLayout linearLayout=new LinearLayout(context).

LayoutParams viewLP=new
LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
LayoutParams buttonLP=new
LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
LayoutParams textLP=new
LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
MyView view=new MyView();//Extends from View object.
MyButton button=new MyButton();//Extends from Button object.
MyTextView text=new MyTextView();//Extends from TextView object.

//Now add the objects to the layout.
linearLayout_.addView(view,tableLayoutParms );
linearLayout_.addView(button,tableLayoutParms );
linearLayout_.addView(text,tableLayoutParms );


The above code will only give me a GUI with the view object in it. But
if I reverse the order in which I add the objects all three components
show up. i.e:

linearLayout_.addView(button,tableLayoutParms );
linearLayout_.addView(text,tableLayoutParms );
linearLayout_.addView(view,tableLayoutParms );

But this is not what I want. I'm starting to guess that there is a bug
in Android that will not wrap the view to accomodate for new objects
being added like text and button. If somebody knows of a way to fix
this I'll really appreciate it.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to