小编Rah*_*diq的帖子

在appDelegate中没有调用motionEnded

我想在整个应用程序中集成摇动功能.所以我在appDelegate做所有事情.我需要推送一个viewController,我能够推进motionBegan,但我想做动作.是运动结束在视图控制器中工作,但在app委托中它没有被调用.做为

- (void)applicationDidBecomeActive:(UIApplication *)application {
     [self becomeFirstResponder];
}
- (BOOL)canBecomeFirstResponder{
    return YES;
}
Run Code Online (Sandbox Code Playgroud)

motionEnded没有调用

-(void) motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    if(event.subtype==UIEventSubtypeMotionShake){
        NSLog(@"motionEnded called");
    }
}
Run Code Online (Sandbox Code Playgroud)

motionBegan打来电话

-(void) motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    if(event.subtype==UIEventSubtypeMotionShake){
        NSLog(@"motionBegan called");
    }
}
Run Code Online (Sandbox Code Playgroud)

iphone ios

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

shouldStartLoadWithRequest附加与applewebdata的链接

我收到了HTML格式的描述文本,我正在webview中加载它,如果在描述中单击了一个链接,那么我将它加载到单独的视图控制器中.但是,shouldStartLoadWithRequest给出一些附加链接.这是我的代码

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
if(navigationType == UIWebViewNavigationTypeLinkClicked) {

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    WebsiteViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"WebsiteViewController"];
    vc.url = request.URL.absoluteString;
    NSLog(@"link is : %@", [[request URL] absoluteString]);
    [self.navigationController pushViewController:vc animated:YES];
    return false;
}
return true;
}
Run Code Online (Sandbox Code Playgroud)

它打印出来

link is : applewebdata://038EEEBF-A4C9-4C7D-8FB5-32056714B855/www.yahoo.com
Run Code Online (Sandbox Code Playgroud)

而我正在加载它

[webViewDescription loadHTMLString:description baseURL:nil];
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uiwebview ios

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

android画廊滚动像视图寻呼机

我使用了Gallery和ViewPager小部件,我从Web服务中获取图像,但我无法将它们放在ViewPager中,但在Gallery中很容易.我在ViewPager中使用了这个教程 http://mobile.tutsplus.com/tutorials/android/android-user-interface-design-horizo​​ntal-view-paging/

我想要像ViewPager滚动一样的android Gallery小部件滚动,

这有可能,我该怎么办呢.

android android-gallery android-viewpager

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

iphone facebook登录safari无法打开页面

我正在尝试集成facebook sdk 3.1.1,我在验证时遇到问题,当我在safari中授权应用程序时它说"无法打开页面" - "Safari无法打开页面,因为地址无效"任何猜测?

编辑:如果在设置中添加帐户它工作正常,但如果没有帐户链接,那么必须打开我打开的会话像这样

        [FBSession openActiveSessionWithAllowLoginUI:YES];
Run Code Online (Sandbox Code Playgroud)

它在验证应用程序后打开了Safari [Okay],safari弹出"无法打开页面"并且不打开应用程序.其他认证方式???

iphone facebook

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

在UIViewController上启用接口方向

可能重复:
shouldAutorotateToInterfaceOrientation在iOS 6中不起作用

我正在使用xcode 4.5,我只需要在一个包含webview的viewController上启用接口方向.我该如何启用它.

- (BOOL)shouldAutorotateToInterfaceOrientation 似乎在iOS6中已弃用

iphone uiwebview uiinterfaceorientation ios

0
推荐指数
1
解决办法
277
查看次数