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

Customize Appearance #2

Open
robmontesinos opened this issue Nov 21, 2014 · 4 comments
Open

Customize Appearance #2

robmontesinos opened this issue Nov 21, 2014 · 4 comments

Comments

@robmontesinos
Copy link

I am unable to customize properties such as textColor, font and borderColor.

I tried with the Menu as well as each individual item. I also tried disabling NavBar Appearance to no avail. I really like this control but customizing appearance is pretty important. What am I doing wrong please?

@pavankris
Copy link

For text color & font , i did a small workaround
FCVerticalMenu* item1 = ...
FCVerticalMenu *verticalMenu = ...initWithItems[item1];
item1.textColor =[UIColor blackColor];
item1.font = ...
...
..
..
[verticalMenu show...];

@falaix
Copy link

falaix commented Dec 19, 2014

+1

@baturaykaradag
Copy link

Problem is caused by the -(UIImage *)image:(UIImage *)img withColor:(UIColor *)color method of FCVerticalMenuItemCollectionViewCell.
Replace that with following:

-(UIImage *)image:(UIImage *)img withColor:(UIColor *)color
 {
    if (color) {
        // Construct new image the same size as this one.
        return [img imageWithColor:color];
    }
return img;
}

And add following method to UIImage as category

- (UIImage *)imageWithColor:(UIColor *)color1
{
    UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale);
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextTranslateCTM(context, 0, self.size.height);
    CGContextScaleCTM(context, 1.0, -1.0);
    CGContextSetBlendMode(context, kCGBlendModeNormal);
    CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height);
    CGContextClipToMask(context, rect, self.CGImage);
    [color1 setFill];
    CGContextFillRect(context, rect);
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return newImage;
}

I had to change colors in init method of FCVerticalMenu class because it seems like properties you set after init has no effect.

@gotnull
Copy link

gotnull commented Feb 20, 2015

I can't see the liveBlur feature targeting 8.0.

This is my code:

self.verticalMenu = FCVerticalMenu(items: [item1, item2, item3])
self.verticalMenu.backgroundAlpha = 0.5
self.verticalMenu.borderColor = UIColor(red: 77/255, green: 81/255, blue: 94/255, alpha: 1)
self.verticalMenu.appearsBehindNavigationBar = true
self.verticalMenu.delegate = self

self.navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(named: "menu-icon"), style: .Bordered, target: self, action: Selector("openVerticalMenu:"))

self.verticalMenu.liveBlur = true
self.verticalMenu.liveBlurTintColor = UIColor.blackColor()
self.verticalMenu.liveBlurBackgroundStyle = .BlackTranslucent

self.navigationItem.titleView = UIImageView(imageNamed: "Squeaker_Logo_Heading")
self.navigationController?.navigationBar.setBackgroundImage(UIImage(), forBarMetrics: .Default)
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.backgroundColor = UIColor(red: 77/255, green: 81/255, blue: 94/255, alpha: 1)
self.navigationController?.navigationBar.tintColor = UIColor.whiteColor()

UITabBar.appearance().backgroundColor = UIColor.blackColor()
UITabBar.appearance().selectedImageTintColor = UIColor.whiteColor()
UITabBar.appearance().barTintColor = self.navigationController?.navigationBar.backgroundColor

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

5 participants