Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make this simple dialog fragment semi-transparent
    primarykey
    data
    text
    <p>I am trying to make this simple Dialog semi-transparent:</p> <pre><code>class TestDialog extends SherlockDialogFragment { public TestDialog() { super(); } @Override public Dialog onCreateDialog(Bundle savedInstanceStateBundle ) { AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity()); // Get the layout inflater LayoutInflater inflater1 = getActivity().getLayoutInflater(); // Inflate and set the layout for the dialog // Pass null as the parent view because its going in the dialog layout builder1.setView(inflater1.inflate(R.layout.dlg_test, null)) // Add action buttons .setPositiveButton( "Ok", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { // sign in the user ... } }) .setNegativeButton( "Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { } }); return builder1.create(); } } </code></pre> <p>The Layout is the following:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/test" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/username" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:layout_marginLeft="4dp" android:layout_marginRight="4dp" android:layout_marginBottom="4dp" android:hint="User name" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>I have tried everything, from using a transparent .png as the background drawable of the linear layout, to setting the alpha field to 0.5, to using as a drawable a color equal to 0. I am not able to make that dialog semi-transparent. I don't know even if it is possible. What i would like to create is a dialog like the panel in the following image: <img src="https://i.stack.imgur.com/Xchct.jpg" alt="semi-transparent control panel">. Thanks. Note1: the min sdk required is version 8, the target is the latest (actually, v17).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload