0

I want to make background of a divider about 20% transparent, where there is a color in the background (i.e. light grey)? Below is the screenshot:

enter image description here

Then I came to this link

But not getting, how to proceed for the same for opacity. Please help

Community
  • 1
  • 1
prat
  • 597
  • 8
  • 17

1 Answers1

0
Use frame layout as a main layout .It will overlaps your layout.
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:background="#a8a3841a"
    >


    <LinearLayout
        android:id="@+id/wraper"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="10dp"

        android:background="#e7a3841a"
        android:orientation="horizontal">

        <View
            android:id="@+id/vwVerticalColourBar"
            android:layout_width="5dp"
            android:layout_height="match_parent"
            android:layout_gravity="center_vertical"
            android:background="@color/grey2"
            android:gravity="center_vertical"/>

        <TextView
            android:id="@+id/label"
            style="@style/item"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left"
            android:layout_marginLeft="8dp"
            android:gravity="left"/>

        <TextView
            android:id="@+id/label2"
            style="@style/subitem"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="left"
            android:layout_marginLeft="8dp"
            android:gravity="left"/>
    </LinearLayout>

</FrameLayout>

Hope it will help you .

Gevaria Purva
  • 552
  • 5
  • 15
  • I don't want any layout correction, for different conditions I have to show different color with dark color view, also I have white color as background as u show in ur framelayout. My xml is not complete, I kept only the relevant code which is useful – prat Jun 23 '16 at 07:53