Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old December 14th, 2011, 07:43 PM   #1 (permalink)
New Member
 
Join Date: Dec 2011
Posts: 2
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default Many Widgets in one layout

Hi,

I'm pretty new to Android development, so this could be a silly question, but silly or not, I need to get this working!

I'm building a layout where the user has to enter a lot of personal data, like full name, birth date, birth place, weight, sex, etc.. I'm using EditText widgets for capturing that information using the layout editor in Eclipse.

The issue I'm having is that after 4 or 5 EditText widgets I don't have any space left in the layout to drag and drop more widgets. I tried adding them manually in the xml view, but when I run the layout, I get a lot of them overlapped in the last row of the screen. I tried adding them to a ScrollView, but I had the same result. I can't find a way to continue adding widgets with the possibility to scroll down the screen so they can all fit in a single layout.

As I said before, I'm a newbie in Android development and this is the first application I'm trying to develop, so maybe there is a really simple way to accomplish this task that I'm not aware of! In Java Swing programming this is a trivial thing, so I don't think it's too complicated in Android development.

Any help or suggestions would be really appreciated! Thanks in advanced!

Regards

pepe1587 is offline  
Reply With Quote
Sponsors
Old December 19th, 2011, 02:55 PM   #2 (permalink)
Member
 
Join Date: Aug 2010
Location: Norway
Posts: 308
 
Device(s): Samsung Galaxy Nexus
Thanks: 0
Thanked 52 Times in 51 Posts
Default

This xml layout will put all EditText widgets under each other.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ScrollView
	xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent"
	android:orientation="vertical">
	<LinearLayout
		android:orientation="vertical"
		android:layout_width="fill_parent"
		android:layout_height="wrap_content">
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
		<EditText
			android:layout_width="fill_parent"
			android:layout_height="wrap_content"
			android:layout_gravity="center_horizontal" />
	</LinearLayout>
</ScrollView>
__________________
Android: Personal Storage, Lars Monsen Facts(Norwegian)
miXer is offline  
Reply With Quote
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:19 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo