Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding in code not working #21

Closed
rajohns08 opened this issue Apr 13, 2015 · 6 comments
Closed

Adding in code not working #21

rajohns08 opened this issue Apr 13, 2015 · 6 comments

Comments

@rajohns08
Copy link

When I add a ProgressWheel in code with:

ProgressWheel loadingDialog = new ProgressWheel(context);
loadingDialog.spin()

nothing happens.

@brucewuu520
Copy link

me too, are you solve?

@rajohns08
Copy link
Author

No, I just used the xml code

@brucewuu520
Copy link

i solve it, you must setLayoutParams with width and height

@rajohns08
Copy link
Author

I tried:

ProgressWheel loadingWheel = new ProgressWheel(this);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(60, 60);
loadingWheel.setLayoutParams(layoutParams);
loadingWheel.setBarColor(Color.GREEN);
loadingWheel.spin();

but it still doesn't work for me.

@gunhansancar
Copy link

rajohns08 you have to add progresswheel to some view after that it can be visible.

        RelativeLayout.LayoutParams params = new   RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
        params.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);

        progressWheel = new ProgressWheel(this);
        progressWheel.setBarColor(Color.GREEN);
        progressWheel.setLayoutParams(params);
        progressWheel.spin();

        rootView.addView(progressWheel);

@nico2sh
Copy link
Owner

nico2sh commented Sep 9, 2015

as @gunhansancar said, you ahve to add the wheel somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants