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 nib breaks PullableView #6

Open
bugs181 opened this issue Mar 4, 2014 · 4 comments
Open

Adding nib breaks PullableView #6

bugs181 opened this issue Mar 4, 2014 · 4 comments

Comments

@bugs181
Copy link

bugs181 commented Mar 4, 2014

The following code adds a nib view to PullableView however it does not function after.

For example:

UILabel *pullUpLabel;
pullUpLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 4, 320, 20)];
pullUpLabel.textAlignment = UITextAlignmentCenter;
pullUpLabel.backgroundColor = [UIColor clearColor];
pullUpLabel.textColor = [UIColor lightGrayColor];
pullUpLabel.text = @"Pull me up!";

[pullUpView addSubview:pullUpLabel];

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
label = [[UILabel alloc] initWithFrame:CGRectMake(0, 80, 320, 64)];
label.textAlignment = UITextAlignmentCenter;
label.backgroundColor = [UIColor clearColor];
label.textColor = [UIColor whiteColor];
label.shadowColor = [UIColor blackColor];
label.shadowOffset = CGSizeMake(1, 1);
label.text = @"I only go half-way up!";

[pullUpView addSubview:label];  

NSArray *subviewArray = [[NSBundle mainBundle] loadNibNamed:@"advanced_search" owner:self options:nil ];
UIView *mainView = [subviewArray objectAtIndex:0 ];
mainView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.0];
mainView.opaque = NO;

[pullUpView addSubview:mainView];

Commenting out the last line will make it work again:
[pullUpView addSubview:mainView];

@bugs181
Copy link
Author

bugs181 commented Mar 11, 2014

Bump

@crocodella
Copy link
Owner

Could you please provide more information? What do you mean by "does not function"? What is included in this Nib that is being loaded?

@bugs181
Copy link
Author

bugs181 commented Mar 11, 2014

At the moment, the nib is a blank UIView which will later contain components like a UITableView. "Does not function" means that after adding the UIView ([pullUpView addSubview:mainView];) will make it to where you can't do anything with pullUpView. IE. Tapping or pulling on the Pull me Up! label does nothing. It seems that it's just locked in place. Sorry for not explaining more thoroughly.

@bugs181
Copy link
Author

bugs181 commented Mar 11, 2014

Oh, it should also be noted that Automatic Reference Counting is turned on and iOS Deployment Target is set to 7.0. Everything works as intended until I add the mainView to the subView.

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

2 participants