CustomTabbar *tabbar = [[CustomTabbar alloc]init]; //KVC,更换系统的tabbar为自定义tabbar tabbar.tabbarDelegate = self; [self setValue:tabbar forKeyPath:@"tabBar"];
此处keyPath:@"tabBar",为系统的tabBar声明的私有的成员变量名
时间: 2024-10-21 15:37:59
CustomTabbar *tabbar = [[CustomTabbar alloc]init]; //KVC,更换系统的tabbar为自定义tabbar tabbar.tabbarDelegate = self; [self setValue:tabbar forKeyPath:@"tabBar"];
此处keyPath:@"tabBar",为系统的tabBar声明的私有的成员变量名