To hide the layout located at the bottom and expand the scroll view when touching the scroll view at the top I used a method of reducing the weight. (I'm not sure if this is right because I'm a beginner.))
However, it is not a problem before the scroll view expansion, but after the expansion, the background image increased;;;;
Is there a way to specify the background image like ImageView scale Type Matrix?
android
The android:background
property in View cannot be scaleType. When configuring the layout, place the ImageView at the beginning of the layout, just as you set the image to android:background
.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
android:layout_width="match_parent"
android:layout_width="match_parent">
<!-- ImageView to use as background -->
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/background"
android:scaleType="matrix" />
<!-- Views to be exposed on the background -->
...
...
</FrameLayout>
If you cannot configure the layout of your choice in the above way, you can also create a custom view and process it by drawing your own background image. Refer to the links below for how to draw a bitmap.
© 2024 OneMinuteCode. All rights reserved.