I'm having the following problem;
I have a LinearLayout with in it a ScrollView, in the ScrollView is some custom view. Now I want to put an image in the background of the LinearLayout and keep the image in its original size. But when I set the background property of the LinearLayout it stretches to fit the full screen. How can I make it so that the image keeps its 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>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…