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 October 21st, 2011, 11:08 PM   #1 (permalink)
New Member
 
Join Date: Oct 2011
Posts: 3
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multi fieldlistView or equivalent

I am new to android development and have been tasked with developing an app. One of the screens will require there to be a list of people with some thumbnail information about them, similar to:

Code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="?android:attr/listPreferredItemHeight"
    
    android:padding="6dip">
    
    <ImageView
        android:id="@+id/icon"
        
        android:layout_width="wrap_content"
        android:layout_height="fill_parent"
        android:layout_marginRight="6dip"
        
        android:src="@drawable/icon" />

    <LinearLayout
        android:orientation="vertical"
    
        android:layout_width="0dip"
        android:layout_weight="1"
        android:layout_height="fill_parent">

        <TextView
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
                    
            android:gravity="center_vertical"
            android:text="Fist, Last" />
            
        <TextView  
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1" 
            
            android:singleLine="true"
            android:ellipsize="marquee"
            android:text="Description" />
            
    </LinearLayout>

</LinearLayout>
This information will be stored in an SQLite DB. Now I can see that listView seems only to work with a single column. What is the best way to go about this?

chrisbay90 is offline  
Reply With Quote
Sponsors
Old October 22nd, 2011, 03:48 PM   #2 (permalink)
Senior Member
 
TheCompBoy's Avatar
 
Join Date: Oct 2010
Location: Sweden
Posts: 594
 
Device(s): Samsung Galaxy S w DarkyROM v10.1
Thanks: 4
Thanked 56 Times in 51 Posts
Send a message via Skype™ to TheCompBoy
Default

Maybe you're looking for the "RelativeLayout"

Here is some tutorial and how it looks:
1.Learn Android : Android Layout Tutorial
2.Relative Layout | Android Developers
__________________
Please check out my blogg: www.thecompboy.blogspot.com
If you want to support me please subscribe / follow the blogg!

OCalc - First App: https://market.android.com/details?id=mendel.calculator.simple&feature=search _result
TheCompBoy is offline  
Reply With Quote
Old October 28th, 2011, 07:34 PM   #3 (permalink)
New Member
 
Join Date: Oct 2011
Posts: 3
 
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by TheCompBoy View Post
Maybe you're looking for the "RelativeLayout"

Here is some tutorial and how it looks:
1.Learn Android : Android Layout Tutorial
2.Relative Layout | Android Developers
Thank you for taking the time to replay. A relative layout may be preferable to a linear one. However it still doesnt solve the problem I'm having.

How do I use this layout and repeat it for as many times as there are records in a table. Populating the various textViews with the different columns of the table?
chrisbay90 is offline  
Reply With Quote
Old October 30th, 2011, 03:30 PM   #4 (permalink)
Senior Member
 
Join Date: Jul 2010
Posts: 977
 
Device(s): Samsung Galaxy S II, HTC Evo 4G, Amazon Kindle Fire
Thanks: 52
Thanked 199 Times in 144 Posts
Default

You will need to create and populate the layout dynamically as the records are read in at runtime.
jonbonazza is online now  
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:09 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo