> I am new to Android development. I have been searching google to add > multiple components to a View programmatically .i.e add TextField, > Button, etc one below the other. > > I could only find examples where they have used XML to design the UI. > If i want to add the components programmatically how can I do that or > I will have design the UI only using the XML.
Use normal constructors (e.g., new TextView(this);) and add them manually to their containers (layout.add(textview, params);). Bear in mind that if you do this, you will have much work in front of you to handle: -- screen rotations (portrait versus landscape) -- multiple screen dimensions (QVGA, HVGA, WVGA) -- multiple screen sizes (3", 3.5", 5") The layout framework was designed to make it easier to swap in and out different layouts for those different device characteristics. -- Mark Murphy (a Commons Guy) http://commonsware.com Android App Developer Books: http://commonsware.com/books.html --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

