ProgressDialog the background of the popup is dimmed

Source: Internet
Author: User

Background: When making a progress bar, do not want its background dimmed, so as not to affect the normal display of other areas.

Most of the methods you see when searching the Web are:

Method One: In the code can be set so Window Mwindow = GetWindow ();
Windowmanager.layoutparams LP = Mwindow.getattributes (); Lp.dimamount =0f;

Method Two: Set the following in the style XML

<resources>

<style name= "Dialog" parent= "@android: Style/theme.dialog" >

<item name= "android:backgrounddimenabled" >false</item> <!--activity is not dimmed --

</style>

</resources>

Set to True, darken background Dialog = new Dialog (Activity, R.style.dialog);

Because I use Progrossdialog, I try to use method one, not successful.

Then I use the second method, in the Values folder to add Style.xml, which writes the above code, with Progressdialog.setprogressstyle (R.style.dialog);

It also didn't work, and here I think Progressstyle should refer to the style of the progress bar, regardless of the background. Just holding on to the attitude of trying. Feel that you should be able to customize its background through Setview, but it's relatively troublesome.

Later, see this way:

Method Three: Similarly configure style, such as method two, and then in the pop-up window of the parent window or activity of the business base class, write code:
protected void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); SetTheme (R.style.dialog); }

Try it out and fix the problem.

ProgressDialog the background of the popup is dimmed (turn)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.