Cannot show modal ViewController in iOS7

前端 未结 10 1011
借酒劲吻你
借酒劲吻你 2020-12-06 02:06

I tried to show system defined viewcontrollers (MFMailComposeViewController, TWTweetComposeViewController,etc..) as a modal view.

But these viewcontrollers dosn\'t a

相关标签:
10条回答
  • 2020-12-06 02:15

    I am getting the same behavior in the same situations. In my case it turned out to be caused by using the "setSeparatorInset" appearance selector of UITableView. Getting rid of that fixed the problem. This looks like a bug on Apple's end for sure, but at least there is a workaround.

    This question shows someone having a similar problem and in their case getting rid of a UISearchBar appearance selector fixed it. So something is wrong with some of these UIAppearance selectors.

    0 讨论(0)
  • 2020-12-06 02:15

    In My case, following code will cause the same issue on 64bit machine or simulator. Hope for helping someone met this issue.

    if ([UITableViewCell instancesRespondToSelector:@selector(setSeparatorInset:)]) {
        [[UITableViewCell appearance] setSeparatorInset:UIEdgeInsetsZero];
    }
    
    0 讨论(0)
  • 2020-12-06 02:18

    This is an issue when you do not compile for 64bit (arm64) in your project settings. Though this may not always be an option for some people because currently Google Analytics does not support the 64bit devices.

    0 讨论(0)
  • 2020-12-06 02:18

    This Problem occurs in iPad air (64 bit) when app is not complied for 64 architecture. The problem I encountered was every UIAppearance selector which try to use UIOffsetMake/UIOffsetZero doesn't work properly! example

        [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(1.0, 1.0) forBarMetrics:UIBarMetricsDefault];
    

    or

        [[UITableViewCell appearance] setSeparatorInset:UIEdgeInsetsMake(0, 5, 0, 5)];
    

    I think its a bug in Apple code and I tried few things but nothing works. Better if you can comment out places where you setInsets in UIAppearance selectors

    0 讨论(0)
  • 2020-12-06 02:20

    I updated xcode to version 5.1 and it worked ok now.

    0 讨论(0)
  • 2020-12-06 02:26

    You may be able to avoid this issue with some subclassing. I was having the same issue, and in my case the culprit was:

    [[UISearchBar appearance] setSearchTextPositionAdjustment:UIOffsetMake(15.0f, 0.0f)];
    

    I was already using a subclass of UISearchBar anyway, so I changed that to:

    [[KA_SearchBar appearance] setSearchTextPositionAdjustment:UIOffsetMake(15.0f, 0.0f)];
    

    That's resolved the issue for me. Only tested on an iPhone 5s, iOS 7.0.3.

    0 讨论(0)
提交回复
热议问题