In the first View of my android application I want to have a image of a border in the top of the view.
I wonder how I can set the image to be fixed only in the left side in my .xml? It should not be fixed in the right side because the picture is long and when you run the app on a tablet with a big screen more of the picture will show from the right side.
Is this possible?
Here is my code for now and it is the imageView2 that I want to do this with:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:background="@drawable/bakgrundsbild"
tools:context=".FirstView" >
<ImageView android:id="@+id/imageView1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_centerHorizontal="true"
android_layout_gravity= "center"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:src="@drawable/icon_bakgrund_android">
</ImageView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon_med_logga"
android:id="@+id/imageView2"
android:layout_alignParentLeft="true" android:layout_alignTop="@+id/imageView1"/>
<Button
android:id="@+id/button1"
android:layout_width="280dp"
android:layout_height="50dp"
android:text="@string/manadens_sollefteblad"
android:background="@drawable/nybutton"
android:layout_alignLeft="@+id/button3" android:layout_alignParentTop="true" android:layout_marginTop="473dp"/>
<Button
android:id="@+id/button2"
android:layout_width="280dp"
android:layout_height="50dp"
android:text="@string/rabattkuponger"
android:background="@drawable/nybutton"
android:layout_alignLeft="@+id/button1" android:layout_alignParentTop="true" android:layout_marginTop="408dp"/>
<Button
android:id="@+id/button3"
android:layout_width="280dp"
android:layout_height="50dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/sa_fungerar_det"
android:background="@drawable/nybutton" />
<Button
android:id="@+id/button4"
android:layout_width="280dp"
android:layout_height="50dp"
android:text="@string/uppdatera"
android:background="@drawable/nybutton"
android:layout_alignLeft="@+id/button1" android:layout_alignParentTop="true" android:layout_marginTop="537dp"/>
</RelativeLayout>