I want to make the background of the dialog transparent on Android

Asked 2 years ago, Updated 2 years ago, 135 views

1

I'd like to make the black background painted with arrows transparent in this picture What should I do?

final Dialog dialog = new Dialog(Screen1.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.themechanger); 

This is my sauce.

android android-dialog

2022-09-22 14:21

1 Answers

In the code

 dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));

you can add it.


2022-09-22 14:21

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.