2017-09-02 15 views
0

私はオーバーレイ(Photoshopのようなブレンディングモード)で背景イメージの上に線形レイアウトをしようとしています。リニアレイアウトオーバーレイと背景画像

解決できません。

この

は、勾配画像のアプリの背景として使用されることになっている:

enter image description here

で私を助けてください:

enter image description here

それは私がオーバーレイ背景画像にしたい方法ですサンプルコードまたは良いチュートリアルへのリンク。あなたは、スクロールビューを使用することができますしたい場合

+0

あなたの親レイアウトで['android:foreground'](https://developer.android.com/reference/android/view/View.html#attr_android:foreground)属性として適用しようとしましたか? – PPartisan

+0

はい、私はアンドロイドを適用しようとしています:フォアグラウンドの属性がそれを解決することはできません.. @PPartisan –

+0

それはあなたが上層の透明性を再生する必要があるようです。あなたの背景イメージを描画可能なままにして、それを背景レイヤーに割り当てるか、イメージとを使用してトリミングを行い、それを拡大縮小することができます。 –

答えて

0
<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>