Changing the position of the background in a LinearLayout

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

Changing the position of the background in a LinearLayout

Postby Stam » Thu Jan 14, 2010 4:16 pm

Hi !

I need to change the position of my background in a LinearLayout, but I can't find how (and if it's really possible...)

I just need to set it at the right of my linearLayout... (I can't use ImageView, because I need to write some dynamic text on this image, and I have to put another image on this one)

Can you help ? Thanks !

With Image, it's better !

I need to do that :

Image

With the 2 image in my Attachment.

(For me, the dog will be an Image, and what he have in his hand the background, so I can add text to in my background)
Attachments
chienleft2.png
chienleft2.png (15.57 KiB) Viewed 129 times
pancarte2.png
pancarte2.png (10.99 KiB) Viewed 129 times
Stam
Junior Developer
Junior Developer
 
Posts: 22
Joined: Wed Nov 25, 2009 1:49 pm
Location: Lille, France

Top

Postby icobasco » Fri Jan 15, 2010 9:35 am

If you wanna specify positions, you should use RelativeLayouts....

Something like:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. <RelativeLayout.....>
  3.  
  4.  
  5.  
  6.         <ImageView
  7.  
  8.                 android:id="@+id/imgFootPrint"
  9.  
  10.         />
  11.  
  12.  
  13.  
  14.         <ImageView
  15.  
  16.                 android:id="@+id/imgEnvelope"
  17.  
  18.                 android:layout_below="@+id/imgFootPrint"
  19.  
  20.         />
  21.  
  22.  
  23.  
  24.         <ImageView
  25.  
  26.                 android:id="@+id/imgDog"
  27.  
  28.                 android:layout_toLeftOf="@+id/imgDashboard"
  29.  
  30.                 android:layout_marginRight="-10dip"
  31.  
  32.         />
  33.  
  34.  
  35.  
  36. </RelativeLayout>
  37.  
  38.      
  39.  
  40.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Playing with margins to put the dog's leg on the dashboard.
User avatar
icobasco
Senior Developer
Senior Developer
 
Posts: 108
Joined: Thu Jun 04, 2009 11:12 am
Location: Italy

Postby Stam » Fri Jan 15, 2010 1:14 pm

Ah yes, ok, thanks you a lot !
Stam
Junior Developer
Junior Developer
 
Posts: 22
Joined: Wed Nov 25, 2009 1:49 pm
Location: Lille, France

Postby icobasco » Fri Jan 15, 2010 1:16 pm

You're welcome :)
User avatar
icobasco
Senior Developer
Senior Developer
 
Posts: 108
Joined: Thu Jun 04, 2009 11:12 am
Location: Italy

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 7 guests