DejalActivityView

Hi David,

Thank you so much for the DejalActivityView. I have a question ( i am somewhat of a newbie to ios programmig).... I am running your DejalActivityView.h/m with a VERY VERY simple demo program... single view and i declare this in my viewDidLoad

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.view addSubview:[DejalActivityView activityViewForView:self.view]];

}

and it works!!! AWESOME! :) ..........but can you please explain to me

1. how you get the activity indicator and the default text to appear at the center? i stepped through your code and for the life of me I cannot see where you do that

2. in the following method

- (UILabel *)makeActivityLabelWithText:(NSString *)labelText;
{
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
   
    label.font = [UIFont systemFontOfSize:[UIFont systemFontSize]];
    label.textAlignment = UITextAlignmentLeft;
    label.textColor = [UIColor blackColor];
    label.backgroundColor = [UIColor clearColor];
    label.shadowColor = [UIColor whiteColor];
    label.shadowOffset = CGSizeMake(0.0, 1.0);
    label.text = labelText;
   
    return label;
}

you pro grammatically create a text label box, but its (0,0,0,0), so how on earth does the text show up???

David Sinclair's picture

Re: DejalActivityView

That's not the correct way to show the DejalActivityView.

When you want the view to show up, simply call this, without adding it as a subview:

[DejalActivityView activityViewForView:self.view]

That method will add it as a subview automatically, and take care of showing it etc.

See the demo project for examples.

Re: DejalActivityView

I did look at the demo, i did not really get it.

1. why shouldn't I add it to subview? the class method provided returns a UIView object right?

and also can you answer my 2 questions above please :)

David Sinclair's picture

Re: DejalActivityView

As I said, that method will add it as a subview automatically, and take care of showing it etc. Adding it again will end up with it added twice.

As for your questions on the implementation, sorry, I don't have time to go into it at present; please study the code and read the comments, and you should be able to figure it out. You don't need to know how it does its magic to be able to use it.

Re: DejalActivityView

ok thanks, now i see why I do not need to add it to the subview, because a pointer to the view is passed.

as for the other questions I still dont get it, I guess please respond at your convenience.