小编fgu*_*aar的帖子

如何使用Xcode UITests点击特定点

我想使用Fastlane Snapshot的 Xcode UI测试来制作Cordova应用程序的屏幕截图.基本上,由于我的整个应用程序只是一个Web视图,所有Xcode UI测试助手方法都变得无关紧要,我只想点击特定的点,例如tap(x: 10, y: 10)应该产生点击{10px; 10px}.

这可能很简单,但我无法弄清楚如何做到这一点.

谢谢.

ios swift xcode7 xcode-ui-testing fastlane-snapshot

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

禁用手势识别器

我有一个简单的记忆游戏。但我想关闭水龙头功能。

当我使用imageViewGurka1.gestureRecognizers=NO;它时可以使用,但收到警告消息:Initialization of pointer of type 'NSArray *' to null from a constant boolean expression。(我应该怎么做才能解决此警告消息?)

而且,如果我使用此选项imageViewGurka1 setUserInteractionEnable:NO;,则不会收到警告消息,但将无法再移动图像。

这是一些代码。

-(IBAction)handleTapGurka1:(UIGestureRecognizer *)sender {

if (imageViewGurka1.tag == 0) {
    [imageViewGurka1 setImage:[UIImage imageNamed:@"memorySångerGurka.png"]];
    imageViewGurka1.tag=1;
    [self.view bringSubviewToFront:imageViewGurka1];

}

else {
    [imageViewGurka1 setImage:[UIImage imageNamed:@"memorySångerBaksida.png"]];
    imageViewGurka1.tag=0;
    [self.view bringSubviewToFront:imageViewGurka1];
}

if (imageViewGurka1.tag==1 && imageViewGurka2.tag==1) {
    NSURL *musicFile;
    musicFile = [NSURL fileURLWithPath:
                 [[NSBundle mainBundle]
                  pathForResource:@"applader"
                  ofType:@"mp3"]];
    myAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:musicFile error:nil];
    [myAudio play];
    //[imageViewGurka1 setUserInteractionEnabled:NO];
    //[imageViewGurka2 setUserInteractionEnabled:NO];
    imageViewGurka1.gestureRecognizers=NO;
    imageViewGurka2.gestureRecognizers=NO;
}

}
Run Code Online (Sandbox Code Playgroud)

谢谢你的帮助! …

ipad uigesturerecognizer ios uitapgesturerecognizer

7
推荐指数
2
解决办法
7079
查看次数

今天视图扩展中的UISlider(小部件)

UISlider在iOS8 Today Extension中使用了一个麻烦.当您开始向右滑动滑块时,一切正常.您可以继续从左向右滑动,反之亦然.

但是,如果您开始向左滑动,通知中心将从"今日"视图滚动/滑动到"通知"视图.

谁能帮我搞清楚,如何禁用这种行为?

objective-c ios ios8 ios8-today-widget

6
推荐指数
1
解决办法
992
查看次数

tabBarController是零; 无法更改viewDidLoad上的selectedIndex

我有一个像这样的UITabBarController:

/*SomeTabBarController.h*/
@interface SomeTabBarController: UITabBarController
@end
Run Code Online (Sandbox Code Playgroud)

SomeTabBarController.m中我想更改viewDidLoad上的活动选项卡

-(void)viewDidLoad
{
  [super viewDidLoad];
  self.tabBarController.selectedIndex = 2;
}
Run Code Online (Sandbox Code Playgroud)

但是,tabBarController是.我错过了什么?我有一个导航控制器和segue推送到标签栏控制器...

谢谢

tabbar uitabbarcontroller tabbarcontroller uitabbar ios

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