android - Scale background image in LinearLayout -


i'm having following problem;

i have linearlayout in scrollview, in scrollview custom view. want put image in background of linearlayout , keep image in original size. when set background property of linearlayout stretches fit full screen. how can make image keeps original size?

my xml:

<?xml version="1.0" encoding="utf-8"?> <linearlayout   xmlns:android="http://schemas.android.com/apk/res/android"   android:id="@+id/root"   android:layout_width="fill_parent"   android:layout_height="fill_parent"   android:background="@drawable/some_drawable">   <scrollview     android:id="@+id/scrollview"     android:layout_height="wrap_content"     android:layout_width="fill_parent"     android:fillviewport="true">     <some.custom.layout         android:id="@+id/mainlayout"         android:layout_height="wrap_content"         android:layout_width="fill_parent"         />   </scrollview> </linearlayout> 

try using framelayout imageview , linearlayout inside. example, try changing alpha of image , move foreground in framelayout, linearlayout stays on background. hope helps!


Comments