Re: [iPhone] Adding a UIView to current view
Re: [iPhone] Adding a UIView to current view
- Subject: Re: [iPhone] Adding a UIView to current view
- From: Philip Vallone <email@hidden>
- Date: Thu, 21 Jan 2010 18:58:54 -0500
Thank you Luke,
That was it.
Thanks,
Phil
On Jan 21, 2010, at 6:38 PM, Luke the Hiesterman wrote:
> Standard first question: did you verify that myBubble is non-nil?
>
> Another note: it's weird that you do [self.view addSubview:myBubble] when through the rest of the method you always use self.myBubble. You should stick to using your property.
>
> Luke
>
> On Jan 21, 2010, at 3:33 PM, Philip Vallone wrote:
>
>>
>> Hi List,
>>
>> I have a UIView (BubbleView) that I want to add to my current view (a loading splash screen). I have synthesized "myBubble". I have a method that when called is suppose to add the view, but the view doesn't show up.
>>
>> I am not sure what I am missing....
>>
>> ChapterViewController.h
>>
>> @interface ChapterViewController : UIViewController <UIActionSheetDelegate> {
>>
>> BubbleView *myBubble;
>> }
>>
>> @property(nonatomic, retain )BubbleView *myBubble;
>>
>>
>> ChapterViewController.m
>>
>> - (void) showLoading{
>>
>>
>> self.myBubble.frame = CGRectMake(30, 100, 260, 220);
>> self.myBubble.backgroundColor = [UIColor clearColor];
>>
>> CGRect contentRect = CGRectMake(35, 30, 240, 40);
>>
>> UILabel *textView = [[UILabel alloc] initWithFrame:contentRect];
>>
>> textView.text = @"Loading ...";
>> textView.numberOfLines = 1;
>> textView.textColor = [UIColor whiteColor];
>> textView.backgroundColor = [UIColor clearColor];
>> textView.font = [UIFont systemFontOfSize:22];
>>
>> [self.myBubble addSubview:textView];
>>
>> UIActivityIndicatorView * activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(110, 100, 50, 50)];
>> activityIndicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
>> [activityIndicator startAnimating];
>> [activityIndicator hidesWhenStopped];
>>
>> [self.myBubble addSubview:activityIndicator];
>>
>> [self.view addSubview:myBubble];
>>
>> [activityIndicator release];
>> [textView release];
>>
>>
>> }
>>
>> Thanks for the help,
>>
>> Phil
>>
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden