Dialog setting Translucent effects

Source: Internet
Author: User

First, the way XML is implemented

  <style name= "Circular_dialog" parent= "@android: Style/theme.dialog" > <item name= "Android:windowframe" > @null </item><!--have borderless--<item name= "android:windowisfloating" >true</item><!--suspended in act  Ivity--<item name= "android:windowistranslucent" >false</item><!--Translucent-to-<item Name= "Android:windownotitle" >true</item><!--set with untitled--<item name= "Android:windowbackground" ; @android:color/transparent</item><!--Set Background transparency--<item name= "android:backgrounddimenabled" >fa  lse</item><!--Setting whether the background is blurry-<item name= "Android:backgrounddimamount" >0.6</item><!--Grayscale --<item name= "Android:windowcontentoverlay" > @null </item><!--dialog box is shaded--<item n Ame= "Android:windowanimationstyle" > @style/dialog_animation</item>< Animation effect!--pop-up or entry-<item nam E= "Android:colorbackgroundCachehint "> @null </item><!--Background Cache color-<item name=" Android:background "> @android: Color/transpa Rent</item>   <!--system transparent??? -
</style>


Use

Dialog = New dialog (context, R.style.circular_dialog);
Dialog.setcontentview (R.layout.progress_dialog);

Second, with the implementation of code

      

Dialog = New dialog (context);
Probar = new ProgressBar (context,null,android. R.attr.progressbarstylelarge);
Layout = new LinearLayout (context);
Layout.addview (probar,new layoutparams (layoutparams.fill_parent,layoutparams.fill_parent));
Dialog.requestwindowfeature (Window.feature_no_title);
Dialog.getwindow (). Setbackgrounddrawableresource (r.color.transparent);
Dialog.setcontentview (layout);

Dialog setting Translucent effects

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.