我以编程方式为UITabBarController
创建视图。
单位**ViewController.m
**
@interface ViewController ()
{
UITabBarController *tabBarController;
MainViewController *mainView;
GroupViewController *grpView;
}
-(id)init
{
self=[super init];
[self initControl];
return self;
}
-(void)initControl
{
}
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"ViewController - viewDidLoad");
self.mainView=[[MainViewController alloc] init];
self.grpView=[[GroupViewController alloc] initWithNibName:@"GroupViewController" bundle:[NSBundle mainBundle]];
self.meView=[[MeViewController alloc] initWithNibName:@"MeViewController" bundle:[NSBundle mainBundle]];
UITabBarItem *tempItem=[[UITabBarItem alloc] initWithTitle:NSLocalizedString(@"Device", @"Device") image:[[UIImage imageNamed:@"device1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] tag:1];
tempItem.selectedImage=[UIImage imageNamed:@"device"];
mainView.tabBarItem=tempItem;
tempItem.imageInsets = UIEdgeInsetsMake(0.0, 0, -0.0, 0);
tempItem=[[UITabBarItem alloc] initWithTitle:NSLocalizedString(@"Group", @"Group") image:[[UIImage imageNamed:@"group1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] tag:2];
tempItem.selectedImage=[UIImage imageNamed:@"group1"];
grpView.tabBarItem=tempItem;
tempItem.imageInsets = UIEdgeInsetsMake(0.0, 0, -0.0, 0);
self.tabBarController= [[UITabBarController alloc] init];
NSMutableArray *controllers=[[NSMutableArray alloc] initWithCapacity:2];
[controllers addObject:self.mainView];
[controllers addObject:self.grpView];
self.tabBarController.viewControllers =controllers;
[self.view addSubview:self.tabBarController.view];
self.tabBarController.delegate=self;
}
字符串
当个人热点关闭时,它工作正常。
的数据
当我打开热点,有人连接到iPhone,然后打开应用程序。view
是像下面的屏幕截图当个人热点打开的屏幕。
的
如何解决个人热点开启时的问题?
1条答案
按热度按时间laximzn51#
看看这个
为状态栏添加观察者更改了长度:
字符串
状态栏改变时的动作:
型