• 15
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Xamarin Android Make background Transparent

I'm trying to Display a png Picture on an Operation which is successfully Completed, I wish to make the Background Transparent

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:background="@android:color/transparent"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:src="@drawable/successful"
        android:layout_width="250dp"
        android:layout_gravity="center"
        android:layout_height="140dp"
        android:id="@+id/imageView1" />

</LinearLayout>

In Activity

Dialog alert;
alert = new Dialog(this);
alert.SetContentView(Resource.Layout.SuccessfulPopup);
alert.Show();

Make sure your image's background is transparent i.e. when you open it in an image viewer it should have a transparent background.

If you want a transparent background just use the hex code of White/Black and add 80 before it:

So if you are doing this in In XML it would be something like:

android:background="#80000000"

And if you are doing it through the code it would be something like:

imageView.SetBackgroundColor(Color.Parse("#80000000")); 

or

imageView.SetBackgroundColor(Android.Graphics.Color.Transparent);

Update:

This is how your XAML should look

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
    android:src="@drawable/successful"
    android:layout_width="250dp"
    android:layout_gravity="center"
    android:background="@android:color/transparent"
    android:layout_height="140dp"
    android:id="@+id/imageView1" />

  • 1
Reply Report