Positionning the spinning wheel in a custom progress dialog

时间秒杀一切 提交于 2019-12-13 22:09:34

问题


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>

回答1:


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"/>


来源:https://stackoverflow.com/questions/7738490/positionning-the-spinning-wheel-in-a-custom-progress-dialog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!