LinearLayout - How to get text to be on the right of an icon?

Posted by RED_ on Stack Overflow See other posts from Stack Overflow or by RED_
Published on 2011-01-06T19:43:28Z Indexed on 2011/01/06 19:53 UTC
Read the original article Hit count: 429

Filed under:
|

Hi there, Bit of a newbie when it comes to android, only been working on it properly for a few days but even after all the searching I've done im stumped and nobody seems to know how to help me. I have this so far:

http://img263.imageshack.us/i/sellscreen.jpg

How can I move the text to be besides each icon rather than underneath it? Hoping the gallery won't be moved either. Here is the code i have:

<?xml version="1.0" encoding="utf-8"?>

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scroller"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true" >

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

    <Gallery xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gallery"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>

    <ImageView 
     android:id="@+id/test_image"
     android:src="@drawable/icon"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>

    <TextView  
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="The offcial UK driving theory test application. Over 190 questions."
     />

    <ImageView 
     android:id="@+id/test_image"
     android:src="@drawable/icon"

     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>

    <TextView  
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="The offcial UK driving theory test application. Over 190 questions."/>

    <ImageView 
     android:id="@+id/test_image"
     android:src="@drawable/icon"

     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>

    <TextView  
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="The offcial UK driving theory test application. Over 190 questions."/>

    <ImageView 
     android:id="@+id/test_image"
     android:src="@drawable/icon"

     android:layout_width="wrap_content"
     android:layout_height="wrap_content"/>

    <TextView  
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="The offcial UK driving theory test application. Over 190 questions."/>

    <ImageView 
     android:id="@+id/test_image"
     android:src="@drawable/icon"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     />

    <TextView  
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:text="The offcial UK driving theory test application. Over 190 questions."
        />

    </LinearLayout>

</ScrollView>

Top half of my code doesn't seem to be showing for some reason but it's just the opening of the linear layout. I will be forever grateful to anyone that can help, i've been racking my brains for days and getting nowhere. Really getting stressed out by it. Thanks in advance!!

© Stack Overflow or respective owner

Related posts about android

Related posts about linearlayout