小编del*_*una的帖子

写入Android UI Automator输出控制台

我正在Android UI Automator上写一个小包装器.通常我们可以在控制台中看到测试用例状态.我可以访问它并添加我自己的消息吗?我试过了System.out.println.但它没有用.有没有办法做到这一点?

android android-uiautomator

8
推荐指数
1
解决办法
2624
查看次数

如果这是一个分层架构,为什么我们必须在IPv6中更改应用层?

如果TCP/IP是一个合适的分层架构,为什么我们需要更改应用层中的所有应用程序才能将底层协议IP从版本4更改为版本6?

ipv4 ipv6 layered

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

UIView动画导致UIButton跳转

用户界面以编程方式生成UI.我很少buttonstexboxes在UI中.我开发了一个自定义uidatapicker对象,它从顶部弹出,动画到屏幕中间.当uidatapicker弹出时,我绘制另一个UIView(称为辅助视图)与屏幕的大小,所以屏幕上的所有其他uiobjects除了uidatepicker被禁用.但是当UIDatePicker动画时,UI中的按钮会跳转到另一个位置.我的UI中还有三个按钮.它只发生一个按钮(UIView中的一个UIButon).其他两个按钮都可以.除了按钮文本之外,这些按钮之间没有显着差异.

  • 我删除了之前描述的视图(辅助视图),但问题仍然存在.
  • 我需要知道为什么会发生这种情况如何预防.
  • 我也有很多其他页面工作正常.

代码

-(void)openEditDateTime:(UIDatePickerMode) mode {
    if ([clientView viewWithTag:9]) {
        [self cancelPressed];
    }
    CGRect toolbarTargetFrame = CGRectMake((clientView.frame.size.width/2)-160, (clientView.frame.size.height/2)+91, 320, 44);
    CGRect datePickerTargetFrame = CGRectMake((clientView.frame.size.width/2)-160, (clientView.frame.size.height/2)-125, 320, 216);

    backgroundView = [[UIView alloc] initWithFrame:clientView.bounds];
    backgroundView.alpha = 0;
    backgroundView.backgroundColor = [UIColor blackColor];
    backgroundView.tag = 9;
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cancelPressed:)];
    [backgroundView addGestureRecognizer:tapGesture];
    [clientView addSubview:backgroundView];
    [self bringToFront:backgroundView];

    datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, self.bounds.size.height+44, 320, …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios

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

无法在SpringBoard.app中播放lock.aiff

如果iOS 7 SDK,在SpringBoard.app端有一个名为lock.aiff的声音文件.声音文件的路径如下.

iPhoneSimulator7.0.sdk/System/Library/CoreServices/SpringBoard.app/lock.aiffs
Run Code Online (Sandbox Code Playgroud)

这是我的代码.

    NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.UIKit"] bundlePath];
    NSString *frameworkPath = [path stringByDeletingLastPathComponent];
    NSString *libraryPath = [frameworkPath stringByDeletingLastPathComponent];
    NSString *finalePath = [libraryPath stringByAppendingString:@"/CoreServices/SpringBoard.app/lock.aiff"];

    NSURL *fileURL = [NSURL fileURLWithPath:finalePath];
    SystemSoundID soundID;
    AudioServicesCreateSystemSoundID((__bridge_retained CFURLRef)fileURL,&soundID);
    AudioServicesPlaySystemSound(soundID);
Run Code Online (Sandbox Code Playgroud)

Value of the variable finalePath = "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/System/Library/CoreServices/SpringBoard.app/lock.aiff"

但我无法在模拟器上播放此声音文件.另外,我无法播放SpringBoard.app中的任何声音文件.但我可以成功播放任何其他文件.例如,以下位置的声音文件播放效果很好.

iPhoneSimulator7.0.sdk/System/Library/PrivateFrameworks/AOSNotification.framework/findme_alarm_2.aiff 
Run Code Online (Sandbox Code Playgroud)

我的猜测是因为lock.aiffs在SpringBoard.app中,所以会引起某种问题.所以我怎样才能播放lock.aiff文件.

objective-c ios ios7

2
推荐指数
1
解决办法
1492
查看次数

如何计算iOS中的活动线程数

我想获得iOS应用程序中"活着"的线程数.

我可以threadDictionaryNSThread课堂上使用吗?或者我可以使用mach/thread_info.h

multithreading objective-c ios

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