Problem in aligning different views correctly

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Problem in aligning different views correctly

Postby Johan Degraeve » Fri Dec 04, 2009 12:24 am

Hi all,

i have a problem here.
I'm trying to put text on the screen, which is actually composed of different views, (testview, a spinner, and a textview) but I want them to be shown next to each other, with wrapping when the left of the screen is reached.
Here's the xml that I use, but that simply doesn't work they way I want, see screenshot below

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.         android:id="@+id/addselecteditemview" android:orientation="horizontal"
  4.         android:layout_width="fill_parent" android:layout_height="wrap_content"
  5.         android:scrollbars="vertical">
  6.  
  7.  
  8.                 <TextView style="@style/Standard" android:id="@+id/standardamount"
  9.                         android:layout_width="wrap_content" android:text="standard amount"
  10.                         android:layout_height="wrap_content" />
  11.                 <Spinner android:id="@+id/unit_spinner" android:layout_width="wrap_content"
  12.                         android:layout_height="wrap_content" android:drawSelectorOnTop="true"
  13.                         android:prompt="@string/choose_unit" />
  14.                 <TextView style="@style/Standard" android:id="@+id/fooditemdescription"
  15.                         android:layout_marginLeft="5sp" android:layout_width="wrap_content"
  16.                         android:text="item description" android:layout_height="wrap_content"/>
  17.  
  18. </LinearLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


as you can see, the text on the right side of the spinner should wrap back to the left of the screen. I tried a lot (relativelayout, ..) but probably not everything

Image
regards,

Johan
Johan Degraeve
Experienced Developer
Experienced Developer
 
Posts: 55
Joined: Tue Oct 27, 2009 1:50 pm
Location: Belgium

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Majestic-12 [Bot] and 5 guests