Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- In plist:
- <dict>
- <key>cell</key>
- <string>PSGroupCell</string>
- <key>footerCellClass</key>
- <string>SQDPrefBannerView</string>
- </dict>
- */
- @protocol PreferencesTableCustomView
- - (id)initWithSpecifier:(id)arg1;
- @optional
- - (CGFloat)preferredHeightForWidth:(CGFloat)arg1;
- - (CGFloat)preferredHeightForWidth:(CGFloat)arg1 inTableView:(id)arg2;
- @end
- @interface SQDPrefBannerView : UITableViewCell <PreferencesTableCustomView> {
- UILabel *label;
- }
- @end
- //banner
- @implementation SQDPrefBannerView
- - (id)initWithSpecifier:(PSSpecifier *)specifier {
- self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
- if (self) {
- #define kWidth [[UIApplication sharedApplication] keyWindow].frame.size.width
- CGRect labelFrame = CGRectMake(0, -15, kWidth, 120);
- label = [[UILabel alloc] initWithFrame:labelFrame];
- [label.layer setMasksToBounds:YES];
- [label setNumberOfLines:1];
- label.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:40];
- label.textColor = [UIColor colorWithRed:90/255.0 green:151/255.0 blue:188/255.0 alpha:1.0];
- label.textAlignment = NSTextAlignmentCenter;
- label.text = @"“Quotifications”"; //set text here
- label.alpha = 0.0;
- [self addSubview:label];
- //fade in, optional
- //if you remove this then remove the line setting the alpha to 0.0
- [UIView animateWithDuration:1.3 animations:^() {
- label.alpha = 1.0;
- }];
- }
- return self;
- }
- - (CGFloat)preferredHeightForWidth:(CGFloat)arg1 {
- CGFloat prefHeight = 100.0;
- return prefHeight;
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement