Android 带背景图像的线性布局覆盖
我正在尝试在背景图像的顶部覆盖线性布局(如Photoshop的混合模式) 我解决不了 这是应该用作应用程序背景的渐变图像: 这就是我希望覆盖背景图像的方式: 请帮助我提供示例代码或优秀教程的链接。Android 带背景图像的线性布局覆盖,android,android-drawable,Android,Android Drawable,我正在尝试在背景图像的顶部覆盖线性布局(如Photoshop的混合模式) 我解决不了 这是应该用作应用程序背景的渐变图像: 这就是我希望覆盖背景图像的方式: 请帮助我提供示例代码或优秀教程的链接。 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:background="
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/blue_600"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".UI.Activity.HomeActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_marginTop="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:background="#54e5e5e5"
android:layout_height="200dp">
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:background="#54e5e5e5"
android:layout_marginTop="10dp"
android:layout_height="200dp">
</RelativeLayout>
</LinearLayout>
如果需要,可以使用滚动视图 你试过在你的父布局中将其作为属性应用吗?是的,我试着应用android:foreground属性,但它无法解决这个问题@PPartisanIt似乎需要处理上层的透明度。将背景图像保持为可绘制的,并将其指定给背景层或使用和图像,这允许您使用一些技巧来裁剪和缩放它。