学iOS以来,感觉自定义的东西,比系统自带的要容易操作一点,可修改和执行的空间要多一点。下面说一下用到很多的tabbar。首先,创建一个FButton类,继承UIButton,用来规范tabbar上的按钮。然后,创建一个RootViewController,继承UITabbarC ...
学iOS以来,感觉自定义的东西,比系统自带的要容易操作一点,可修改和执行的空间要多一点。
下面说一下用到很多的tabbar。
首先,创建一个FButton类,继承UIButton,用来规范tabbar上的按钮。
然后,创建一个RootViewController,继承UITabbarController作为根视图控制器。
废话不多说,直接上代码:
在FButton的.m文件中:
#import "FButton.h"@implementation FButton-(id)initWithFrame:(CGRect)frame#pragma mark set image in btn@end
在RootViewController的.h文件中:
#import <UIKit/UIKit.h>@interface RootViewController : UITabBarController//是否隐藏tabbar@end
.m文件中:
@interface RootViewController ()@end@implementation RootViewController- (void)viewDidLoad {#pragma mark 按钮被点击时调用
原标题:自定义tabbar标签栏
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。