0

我是ios开发新手.......

当我的应用程序运行时屏幕顶部出现一个 BAR ..... 其中包含

网络、数字时钟和电池符号

我怎么能隐藏这个酒吧?
提前致谢.........

[window addSubview:navigationController.view];
[window makeKeyAndVisible];


arryName = [[NSMutableArray alloc] initWithObjects:@"Savasana",@"Makarasana",@"Padahastasana",@"Natarajasana",@"Ustrasana",@"Hanumanasana",@"Garbhasana",@"Bhujapidasana",@"Astavakrasana(Eight-Angle Pose)",@"Mayurasana",@"Paschimottanasana",@"Janu Sirsasana",@"Urdhva Mukha Svanasana",@"Urdhva Dhanurasana",@"Bhujangasana",@"Bakasana",@"Surya Namaskar",@"Akarna Dhanur asana",@"Anjaneya asana",@"Ardha Chandra asana",@"Ardha Matsyendra asana",@"Baddha Kona Asana",@"Bala Asana",@"Chakra Asana",@"Dhanur asana",@"Ekapada asana",@"Garuda asana",@"Gomukha asana",@"Hala sana",@"Hasta Pada angusta",@"Matsya asana",@"Naga asana",@"Nataraja asana",@"Padma asana",@"Parivritta parshvakona",@"Pavana mukta asana",@"Sarvanga asana",@"Shalabha asana",@"Shava asana",@"Siddha asana",@"Simha asana",@"Sirsha asana",@"Tada asana",@"Trikona asana",@"Ugra asana",@"Ushtra asana",@"Vajra asana",@"Vira asana",@"Vriksha asana",@"Vrischika asana",@"Anjali Mudra",@"Ardha Matsyendrasana",nil];

arryImage = [[NSMutableArray alloc]initWithObjects:@"savasana_248.jpg",@"crocodile.jpg",@"Padahastasana.jpg",@"Natarajasana_248.jpg",@"Ustrasana_248.jpg",@"Hanumanasana_248.jpg",@"garbhasana.gif",@"bhujapidasana_1.jpg",@"Astavakrasana_248.jpg",@"Mayurasana.jpg",@"Paschimottanasa_248.jpg",@"JanuSirsasana.jpg",@"UrdhvaMukhaSvanasana.jpg",@"UrdhvaDhanurasana.jpg",@"Bhujangasana.jpg",@"Bakasana.jpg",@"1_Surya-namaskar.png",@"2-akarna_dhanurasana.png",@"3-Anjanya.png",@"4-ardha-chand.png",@"5-Adhamatsya.png",@"6-Baddha-kona.png",@"7-child-pose-balasana.png",@"8-Chakrasana-wheel-pose.png",@"9-Dhanura_asana-Bow_Pose.png",@"10-ekapada-asana-the-one-legged-pose.png",@"11-garudasana.png",@"12-gomukhasana.png",@"13-Halasan.png",@"14-Hasta.Padangusthasana.png",@"15-Matsyasana.png",@"16-naga-vj-g.png",@"17-natarajasana.png",@"18--padma.png",@"19--Parivrtta_Parsvakonasana-Revolved_Side_Angle_Pose.png",@"20-PAWANMUKTASANA.png",@"21-SHOULDER STAND.png",@"22--Salabhasana.png",@"23-Savasana.png",@"24-SIDDHASANA.png",@"25-Simha-asan-the lion.png",@"26-Sirsasana.png",@"27-Tada_Asana.png",@"28-Trikona_Asana.png",@"29-Ugra-asna-the Noblepose.png",@"30--ustrasana.png",@"31--Vijrasana.png",@"32-Vira-asna-the hero pose.png",@"33--Vriksha_Asana-Tree_Pose.png",@"34-VariskhikaiPad.png",@"AnjaliMudra.jpg",@"ArdhaMatsyendrasana.jpg",nil];
4

5 回答 5

1

在您的项目 Info.plist 文件中设置状态栏最初是隐藏的,是的,这将隐藏整个项目的状态栏。

在此处输入图像描述

如果您想特别隐藏状态栏,请查看

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:<#(UIStatusBarAnimation)#>];
于 2013-01-29T09:34:27.193 回答
0

其称为状态栏:

如果要隐藏状态栏,请在didFinishLaunchingWithOptions方法中编写以下代码AppDelegate

 [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];

此代码用动画隐藏状态,如果要删除动画,请设置withAnimation:NO

另一种在状态栏隐藏时自动设置 viewController 大小的方法:

 CGRect appFrame = [[UIScreen mainScreen] applicationFrame];

        [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
        [UIView animateWithDuration:0.25 animations:^{
            self.navigationController.navigationBar.frame = self.navigationController.navigationBar.bounds;
            self.view.window.frame = CGRectMake(0, 0, appFrame.size.width, appFrame.size.height);
        }];
于 2013-01-29T09:13:49.900 回答
0

试试下面的代码

[[UIApplication sharedApplication] setStatusBarHidden:YES];
于 2013-01-29T08:54:02.437 回答
0

它被称为“状态栏”。

您可以通过在“AppDelegate”的“AppDidFinishLauching”方法中添加以下行来隐藏它:

[[UIApplication sharedApplication] setStatusBarHidden:YES];

您也可以从 .plist 文件中隐藏它。

干杯。

于 2013-01-29T08:56:49.720 回答
0

在您的ProjectName-Info.plist文件集中Status bar is initially hidden YES

否则使用[[UIApplication sharedApplication] setStatusBarHidden:YES];

于 2013-01-29T08:58:07.090 回答