다음과 같은 문제가 있습니다.LinearLayout의 배율 배경 이미지
나는 LinearLayout에 ScrollView를 가지고 있는데, ScrollView는 사용자 정의보기이다. 이제 LinearLayout 배경에 이미지를 놓고 원래 크기로 이미지를 유지하려고합니다. 그러나 LinearLayout의 배경 속성을 설정하면 전체 화면에 맞게 늘어납니다. 이미지를 원래 크기로 유지하려면 어떻게해야합니까?
내 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>
이것은 나를 위해 일했습니다. 덕분에 많이! – Joris
잘 작동하지만 생각보다 우아한 해결책은 http://stackoverflow.com/questions/2781593/background-image-placement에서 찾을 수 있습니다. – iganev