Code Monkey home page Code Monkey logo

Comments (9)

avicooper1 avatar avicooper1 commented on August 22, 2024

Thanks for looking into this issue. Other than adding the code you have provided, what must I do to enable this feature? Thanks.

from foldingtabbar.ios.

grethi avatar grethi commented on August 22, 2024

I currently do not know another way than adding the hitTest-Method. Do you have any problems with it?

from foldingtabbar.ios.

avicooper1 avatar avicooper1 commented on August 22, 2024

Sorry, I was a bit unclear. I have already added the hitTest method, but what else must I do to make it work? It doesn't seem to change anything.

from foldingtabbar.ios.

grethi avatar grethi commented on August 22, 2024

I use it without any other source code and i am able to touch the space between the centerButton and extraLeftButton/extraRightButton. Make sure the bar is collapsed.

Do you use a special setut and can provide some source code? I utilize the TabBarController with the snippet below.

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // access tabBarController -> Storyboard
    YALFoldingTabBarController *tabBarController = (YALFoldingTabBarController *) self.window.rootViewController;

    // prepare leftBarItems
    YALTabBarItem *one = ...;
    YALTabBarItem *two = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"..."]
                                                    leftItemImage:[UIImage imageNamed:@"..."]
                                                   rightItemImage:[UIImage imageNamed:@"..."] ];

    tabBarController.leftBarItems = @[one, two];

    // prepare rightBarItems
   YALTabBarItem *three = ...;
    YALTabBarItem *four = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"..."]
                                                    leftItemImage:[UIImage imageNamed:@"..."]
                                                   rightItemImage:[UIImage imageNamed:@"..."] ];

    tabBarController.rightBarItems = @[three, four];

    tabBarController.centerButtonImage = [UIImage imageNamed:@"..."];

    tabBarController.selectedIndex = 1;

    // customize tabBarView
    tabBarController.tabBarView.extraTabBarItemHeight = YALExtraTabBarItemsDefaultHeight;
    tabBarController.tabBarView.backgroundColor = [UIColor clearColor];
    tabBarController.tabBarView.tabBarColor = [UIColor redColor];
    tabBarController.tabBarView.tintColor = [UIColor whiteColor];
    tabBarController.tabBarView.dotColor = [UIColor whiteColor];
    tabBarController.tabBarViewHeight = YALTabBarViewDefaultHeight;
    tabBarController.tabBarView.tabBarItemsEdgeInsets = YALTabBarViewItemsDefaultEdgeInsets;
}

from foldingtabbar.ios.

avicooper1 avatar avicooper1 commented on August 22, 2024

Here is my code. I don't see anything differences, but I may not be catching them. Thanks for all the help.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

        let tabBarController = self.window?.rootViewController as! YALFoldingTabBarController
        let item1 = YALTabBarItem(itemImage: UIImage(named: "..."), leftItemImage: nil, rightItemImage: nil)
        let item2 = YALTabBarItem(itemImage: UIImage(named: "..."), leftItemImage: nil, rightItemImage: nil)
        let item3 = YALTabBarItem(itemImage: UIImage(named: "..."), leftItemImage: nil, rightItemImage: nil)
        let item4 = YALTabBarItem(itemImage: UIImage(named: "..."), leftItemImage: nil, rightItemImage: nil)

        tabBarController.tabBarView.offsetForExtraTabBarItems = YALForExtraTabBarItemsDefaultOffset
        tabBarController.leftBarItems = [item1, item2]
        tabBarController.rightBarItems = [item3, item4]
        tabBarController.centerButtonImage = UIImage(named: "PlusIcon")
        tabBarController.tabBarViewHeight = 80.0
        tabBarController.tabBarView.backgroundColor = UIColor.clearColor()
        tabBarController.tabBarView.extraTabBarItemHeight = 60.0
        tabBarController.tabBarView.tabBarViewEdgeInsets = YALTabBarViewHDefaultEdgeInsets;
        tabBarController.tabBarView.tabBarItemsEdgeInsets = YALTabBarViewItemsDefaultEdgeInsets;

        // Override point for customization after application launch.
        return true
    }

from foldingtabbar.ios.

grethi avatar grethi commented on August 22, 2024

Yeah, looks ok. I changed the example to demonstrate the functionality. Check my example branch and take a look at the provided image.

from foldingtabbar.ios.

avicooper1 avatar avicooper1 commented on August 22, 2024

I looked at the branch. It seems that some code that I added was disrupting with your new functionality. I removed it and it worked as you said it would. Do you have any idea how I could rewrite this snippet so that it will work with your new functionality? Thanks.

- (void)setupMainView {
    self.mainView = [[UIView alloc] initWithFrame:UIEdgeInsetsInsetRect(self.bounds, self.tabBarViewEdgeInsets)];

    self.expandedFrame = self.mainView.frame;
    self.mainView.layer.cornerRadius = CGRectGetHeight(self.mainView.bounds) / 2.f;
    self.mainView.layer.masksToBounds = YES;
//    self.mainView.backgroundColor = self.tabBarColor;

    //My edits to the FoldingBar view

    UIVisualEffect *blurEffect;
    blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];

    UIVisualEffectView *visualEffectView;
    visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];

    visualEffectView.frame = self.mainView.bounds;
    [self.mainView addSubview:visualEffectView];

    CALayer *extraColorLayer = [CALayer layer];
    extraColorLayer.frame = CGRectMake(0, 0, self.mainView.frame.size.width, self.mainView.frame.size.height);
    extraColorLayer.backgroundColor = [UIColor colorWithRed: 0.36078 green: 0.517647 blue: 0.698039 alpha: 0.3].CGColor;
    [self.mainView.layer addSublayer:extraColorLayer];

    self.mainView.backgroundColor = [UIColor clearColor];

    [self addSubview:self.mainView];
}

from foldingtabbar.ios.

grethi avatar grethi commented on August 22, 2024

Your visualEffectView is consuming all touches! You should disable its userInteraction to "redirect" touches to its superview (in this case self.mainView).

visualEffectView.userInteractionEnabled = NO;

from foldingtabbar.ios.

avicooper1 avatar avicooper1 commented on August 22, 2024

Thanks so much! Its working now.

from foldingtabbar.ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.