Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion BeeFramework/MVC/View/Bee_UITabBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ AS_SIGNAL( HIGHLIGHT_CHANGED ) // 高亮改变
- (void)addTitle:(NSString *)title image:(UIImage *)image;
- (void)addTitle:(NSString *)title image:(UIImage *)image tag:(NSInteger)tag;
- (void)addTitle:(NSString *)title image:(UIImage *)image tag:(NSInteger)tag signal:(NSString *)signal;

//zhouxl 取消item的徽章 设置item的徽章,在tabbar加载完成显示出来时设置
- (void)clearBadgeValueOnIndex:(NSInteger)index;
- (void)setBadgeValue:(NSInteger)value onIndex:(NSInteger)index;
@end

#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
20 changes: 20 additions & 0 deletions BeeFramework/MVC/View/Bee_UITabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ - (void)setSelectedIndex:(NSInteger)index
UITabBarItem * item = [_barItems objectAtIndex:index];

[self setSelectedItem:item];
[self clearBadgeValueOnIndex:index];//zhouxl
[self tabBar:self didSelectItem:item];
}
else
Expand Down Expand Up @@ -243,7 +244,26 @@ - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
withObject:[NSNumber numberWithInt:item.tag]];
}
}
//zhouxl->
- (void)clearBadgeValueOnIndex:(NSInteger)index{
((UITabBarItem* )[self.items objectAtIndex:index]).badgeValue = nil;
}

- (void)setBadgeValue:(NSInteger)value onIndex:(NSInteger)index{
NSString* valueStr = [NSString stringWithFormat:@"%d",value];
if (index<0 || index>= _barItems.count) {
BeeLog(@"tabbar :the index is out!");
}else if(value == 0){
((UITabBarItem* )[self.items objectAtIndex:index]).badgeValue = nil;
}else if(value < 0){
BeeLog(@"the value below 0!!!");
}else
{
((UITabBarItem* )[self.items objectAtIndex:index]).badgeValue = valueStr;
}

}
//<-zhouxl
@end

#endif // #if (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ - (void)showNavigationBarAnimated:(BOOL)animated
{
[self.navigationController setNavigationBarHidden:NO animated:animated];
}

//隐藏navBar
- (void)hideNavigationBarAnimated:(BOOL)animated
{
[self.navigationController setNavigationBarHidden:YES animated:animated];
Expand Down Expand Up @@ -148,12 +148,19 @@ - (void)showBarButton:(NSInteger)position system:(UIBarButtonSystemItem)index

- (void)showBarButton:(NSInteger)position custom:(UIView *)view
{
//添加点击事件,zhouxl
UITapGestureRecognizer* tap = [[UITapGestureRecognizer alloc]init];
view.userInteractionEnabled = YES;
[view addGestureRecognizer:tap];
if ( UINavigationBar.BARBUTTON_LEFT == position )
{

[tap addTarget:self action:@selector(didLeftBarButtonTouched)];
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:view] autorelease];
}
else
{
[tap addTarget:self action:@selector(didRightBarButtonTouched)];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:view] autorelease];
}
}
Expand Down
2 changes: 1 addition & 1 deletion Example/Lessons/DribbbleBoard.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ - (void)handleUISignal_BeeUIBoard:(BeeUISignal *)signal
if ( [signal is:BeeUIBoard.CREATE_VIEWS] )
{
[self showNavigationBarAnimated:NO];
[self showPullLoader:YES animated:NO];
[self showPullLoader:YES animated:YES];//显示下拉时最上面的信息

self.pullLoader.arrow.image = [UIImage imageNamed:@"bug.png"];

Expand Down
1 change: 1 addition & 0 deletions Example/WhatsBug/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.window.backgroundColor = [UIColor whiteColor];
// 带navbar
self.window.rootViewController = [BeeUIStackGroup stackGroupWithFirstStack:[BeeUIStack stackWithFirstBoard:[CatelogBoard board]]];
[self.window makeKeyAndVisible];

Expand Down