为定位纺车在自定义进度对话框 [英] Positionning the spinning wheel in a custom progress dialog
本文介绍了为定位纺车在自定义进度对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用给出的定义进度对话框<一个href=\"http://stackoverflow.com/questions/3225889/how-to-center-progress-indicator-in-progressdialog-easily-when-no-title-text-pas/3226233#3226233\">here,其中,如下图所示的风格。纺车为中心,我无法找到如何将自定义位置设置它。
任何人都可以帮忙吗?
&LT;?XML版本=1.0编码=UTF-8&GT?;
&LT;资源&GT;
&LT;样式名称=NewDialog&GT;
&LT;项目名称=机器人:窗框&GT; @空&LT; /项目&GT;
&LT;项目名称=机器人:windowBackground&GT; @android:彩色/透明&LT; /项目&GT;
&LT;项目名称=机器人:windowIsFloating&GT;真&LT; /项目&GT;
&LT;项目名称=机器人:windowContentOverlay&GT; @空&LT; /项目&GT;
&LT;项目名称=机器人:windowTitleStyle&GT; @空&LT; /项目&GT;
&LT;项目名称=机器人:windowAnimationStyle&GT; @android:风格/ Animation.Dialog&LT; /项目&GT;
&LT;项目名称=机器人:windowSoftInputMode&GT; stateUnspecified | adjustPan&LT; /项目&GT;
&LT;项目名称=机器人:背景&GT; @android:彩色/透明&LT; /项目&GT;
&LT; /风格&GT;
&LT; /资源&GT;
解决方案
在你的布局使用进度。你可以把它放在你在屏幕上想要的任何位置。
&LT;进度的android:layout_width =WRAP_CONTENT
机器人:layout_height =WRAP_CONTENT
风格=机器人:ATTR / progressBarStyle
机器人:ID =@ + ID / showProgress/&GT;
I'm using the custom progress dialog given here, which as the style shown below. The spinning wheel is centered, and I can't find how to set a custom position to it.
Anybody can help?
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="NewDialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowTitleStyle">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:background">@android:color/transparent</item>
</style>
</resources>
解决方案
Use ProgressBar in your layout . You can place it any position you want in your screen.
<ProgressBar android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/progressBarStyle"
android:id="@+id/showProgress"/>
这篇关于为定位纺车在自定义进度对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文