小编Ami*_*hel的帖子

删除UINavigationItem提示在导航栏底部创建黑色空格

我在我的故事板中有视图控制器,带有提示文本行但是当我在导航栏中按下没有提示行的新视图控制器时,我在导航栏和视图控制器主视图之间得到了这个(见图片)黑色空间.

导航栏下的黑色区域

我已经尝试使用以下方法删除提示:

    [self.navigationItem setPrompt:nil];
Run Code Online (Sandbox Code Playgroud)

但我仍然有这个问题.

prompt objective-c uinavigationcontroller uinavigationitem

7
推荐指数
1
解决办法
1041
查看次数

如何在这个时间从datePicker和run方法中获取时间?

我想从datePicker获取时间到NSDate对象,然后在这个时间每天运行一个方法.例如:用户将日期戳于08:00,并且每天08:00应用程序将运行一些方法.

非常感谢,Amir Foghel

iphone xcode objective-c datepicker ios

5
推荐指数
1
解决办法
1万
查看次数

IOS5中的本地通知 - 如何使其在屏幕上而不是在通知中心中弹出?

我有一个使用本地通知的应用程序.现在当IOS5出来并显示通知警报时 - 它会进入通知中心,现在通过我的2个按钮显示警报(显示和取消).

有人可以帮我看看,所以我可以让它弹出屏幕而不是通知中心(屏幕顶部的行).

这是我的代码:

 UILocalNotification *localNotif = [[UILocalNotification alloc] init];

                localNotif.fireDate=[NSDate date];
                localNotif.timeZone = [NSTimeZone defaultTimeZone];


                localNotif.alertBody = @"Application alerted";

                localNotif.alertAction = @"Show";

                localNotif.soundName = UILocalNotificationDefaultSoundName;
                localNotif.applicationIconBadgeNumber = 0;
                [[UIApplication sharedApplication]presentLocalNotificationNow:localNotif];
                [localNotif release];
Run Code Online (Sandbox Code Playgroud)

谢谢,阿米尔.

iphone objective-c uilocalnotification ios5

4
推荐指数
1
解决办法
3549
查看次数

如何用手指在iphone中移动视图Objective-c

我有这个观点,他的大小是1280 X 345,我在屏幕上左右移动它.现在,我的主要问题是我如何用手指移动(不是swipeLeft/swipeRight)我希望它像iPhone IOS的​​主屏幕一样用我的手指移动.

现在,即时通讯使用此代码:

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
    UITouch *touch = [touches anyObject];
    CGPoint location = [touch locationInView:infoView];
    //[self.view setTransform:CGAffineTransformTranslate(CGAffineTransformIdentity, (location.x + self.view.frame.origin.x - dx), 0.0)];
    NSLog(@"touch: %f",location.x);

    infoView.frame = CGRectMake(infoView.frame.origin.x + location.x, 0, 1280, 345);
}
Run Code Online (Sandbox Code Playgroud)

这应该是目前的方式,但我不能说出来.我也尝试在谷歌和这里找到答案,但是,如你所知..我没有找到有用的东西.

我也做了这个,所以你可以更好地理解它.

在此输入图像描述

iphone cocoa-touch objective-c touch swipe

4
推荐指数
1
解决办法
768
查看次数