1

enter image description hereリニアレイアウトでは、イメージビュー、テキストビュー、およびリニアレイアウトに関係なく編集テキストを使用しています。透明にする必要があるバックグラウンドでイメージを追加しようと思っています。しかし、背景画像だけがページ全体ではなく透明である必要があります。ページ内のデータの透明性に関係なく、Androidスタジオに透明な背景イメージを追加するにはどうすればよいですか?

+0

私はあなたがこのようなものを使用ことをお勧め。あなたは現在の結果と希望の効果のイメージを表示できますか? – JonZarate

+0

iveは現在の画像をアップロードしていますが、透明度25%の背景画像として2枚目の画像を最初の画像に入れたいだけで、他の画像はページの半分をカバーし、 –

答えて

0

私は私の意見では........

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:background="@drawable/download" 
    android:weightSum="2" 
    android:layout_height="match_parent"> 

    <ImageView 
     android:layout_gravity="center" 
     android:src="@drawable/download" 
     android:layout_weight="1" 
     android:layout_width="wrap_content" 
     android:layout_height="0dp" /> 

    <LinearLayout 
     android:layout_weight="1" 
     android:layout_width="match_parent" 
     android:layout_height="0dp"> 

     <TextView 
      android:text="@string/dummy_text" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" /> 

    </LinearLayout> 


</LinearLayout> 

enter image description here

-1

を理解するもの、によると、あなたのデザインがをアピール本当にではありません。テキストが読めないあなたの例では

が、それは同じ画面に二回イメージを持ってしても意味がありません、背景画像は、を伸ばして正面画像がそう小さなです。

Design concept

は、あなたがここで、このようにそれを好きならヨーヨーは、XML定義があります:私はかなりの質問を理解していない

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:app="http://schemas.android.com/apk/res-auto" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:orientation="vertical" 
       android:padding="10dp"> 

    <TextView 
     android:id="@+id/textView" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="Taj Mahal" 
     android:layout_marginBottom="5dp" 
     android:textSize="24sp"/> 

    <View 
     android:layout_height="2dp" 
     android:layout_width="match_parent" 
     android:background="#aaaaaa"/> 

    <ImageView 
     android:id="@+id/imageView" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:adjustViewBounds="true" 
     android:padding="10dp" 
     android:scaleType="fitXY" 
     app:srcCompat="@drawable/taj_mahal"/> 

    <View 
     android:layout_height="2dp" 
     android:layout_width="match_parent" 
     android:background="#aaaaaa"/> 


    <TextView 
     android:id="@+id/textView2" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="10dp" 
     android:text="The Taj Mahal is an ivory-white marble mausoleum on the south bank of the Yamuna river in the Indian city of Agra. It was commissioned in 1632 by the Mughal emperor, Shah Jahan (reigned 1628–1658), to house the tomb of his favourite wife." 
     android:textSize="18sp"/> 
</LinearLayout> 
関連する問題