Open echoz opened 12 years ago
Okay. There is a lot of power inherent in its customizability. I made a small example without screwing around too much with it.
There is still much to do, like adding the glossy effect and all that, but this should be a good jumping off point.
Wow, this looks great! I'm really looking forward to trying it. Probably tomorrow. In the meanwhile, you could do a more detailed example of use if you want to :).
Thanks a lot!
Sure thing. Will probably work on that examples much later. Its been a long weekend. ;)
Of course! No hurries at all :)
Terribly sorry for the additional commits. realised the way i was laying out subviews wasn't ideal. so rewrote the implementation. this should be much better :)
These should be the last commits.
Hi!
I've merged your changes into a new local branch, but it isn't working as expected. I've just launched the example app, with no changes, and it has crashed in line 230 of PrettyTabBar.m
: [item removeObserver:self forKeyPath:@"badgeValue"];
I've commented that line, just to make it run, but there are no tabbar buttons, as seen in the included screenshot.
I see you're still working on the feature, so I'll wait until you're finished :)
Hello hello. fixed the bug. sorry about that. :/
Great!
It works really great. But, when setting a predefined item from Interface Builder, it won't show.
But creating a custom one works great, and this work you're doing looks very powerful. It would be great, by the way, to tint images in not selected items with the same gray level of the text.
Another thing: I think it would be a good idea to remove default values from PrettyTabBarButtons because, as far as I know, they're always set from PrettyTabBar. This will remove duplicity, and it will be faster to change those default values in the future :)
Last one: I've changed this default values to better mimic the default UITabBar:
Yeah. Tinting was a problem to figure out. Will probably commit some other changes at a later date, but this should be ready for use.
Yeah, I was also thinking about all the default values in the PrettyTabBarButton. Just added it to be consistent with the project's settings.
Not too sure what you mean by setting predefined item that won't show in interface builder
A picture is worth a thousand words :)
Ahh! Hmm. That's quite a challenge to get working. I'd probably work on that next weekend. (PrettyKit has been a fun 2 weekends of hacks. :))
But yeah, I guess custom stuff for now.
Hahaha yeah, I'd love to have more time to spend on it too.
I've pushed a new branch called tabbar, with your changes included, and some changes I've made on yours :D. Including removing the default values from tabbar button, a little bit of refactoring, and tinting the item's icon to the same text color when not selected.
I won't merge it with the master branch yet, as I think we can improve it even more :D. But I'm really looking forward to releasing a new version of PrettyKit with this nice tabbar :D
Cheers!
Well, I forgot to add those changes :). I'm doing it right now.
That'll be really exciting to work on. :)
Lets make this really Pretty (pun :P)
Done!
I can't make badges work, though :/
Weird. I've gotten them to work by modifying the View Controller's UITabBarItem's badgeValue.
PrettyTabBar listens for changes to those and changes the value accordingly.
I've tried, before my changes, that way and also through the IB's field, and it didn't seem to work :/. I haven't tried hard, though.
Weird. Works for me.
Insert this at line 34 of the appdelegate:
((UIViewController *)[self.tabBarController.viewControllers objectAtIndex:0]).tabBarItem.badgeValue = @"1";
I did that from the view controller (self.tabBarItem
), that's why it didn't work for me.
Ah! Okay. I think I know what to do for this. :)
i just checked apple's implementation, it also doesn't seem to reflect the change in the badge value.
Further investigation says that if you try to set the badgeValue during viewDidLoad, it doesn't seem to work. However anytime else after the UIViewController has loaded, calling self.tabBarItem.badgeValue = something should work fine and update the tabbar.
Regarding #13:
Translucent tabbars would only probably work if they are not part of the UITabBarController as the content view of the tabbar controller will not resize to encompass the area lost (a la translucent UINavigationBar).
Don't really see a point beyond the fact that this might introduce bad UI design.
Btw, added some more commits previously. Not sure if you've merged them.
I've just merged them.
Hi @echoz. Happy to see tabbar is still alive :D. Do you have any clue about the issue with predefined IB buttons? I mean this: https://github.com/vicpenap/PrettyKit/pull/12#issuecomment-5546144.
I can't give a definitive answer (because I haven't really had the time to look into it), but as of this moment I don't think its possible to use predefined buttons for this :/
Well, as a last resort we could add a note in documentation to explain that.
Yeah. I guess that'll do for now. Will look into it when I have more time on my hands.
This is a huge ass commit. Really sorry for the multiple commits. Should've rebased it first.
That aside, this pull request basically is about an enhanced UITabBar. It has the following features,
This new TabBar is should be a drop in replacement while supporting all callbacks that is expected of a UITabBar. Has been tested with UITabBarControllers to work perfectly. No changes needed to make this work with existing projects, just use PrettyTabBar instead of an UITabBar.
The new class PrettyTabBarButton itself provides more configuration than previously possible for normal UITabBars while still support iOS 4.3.
Some of the configurable options include,
While these options are configurable on the TabBarButton, they are really only settable via usage of the PrettyTabBar as there is tight coupling between both classes (also how Apple seems to do it).
PrettyTabBarButton draws everything using Core Graphics.
Also added some new methods to the PrettyDrawing class.