我正在写一个有iBooks书架视图的应用程序.
现在的问题是:我可以将一本书从一个地方拖放到另一个地方.但是当我将书籍拖到滚动视图的底部时,如何让它们同时发生:
我知道在Github中有一个AQGridView,但似乎跳板演示不支持同时滚动和移动.(我已经将scrollEnable设置为YES)
我正面临一个奇怪的iOS 8.3问题,它显示键盘的方向错误(视图控制器处于横向模式,但键盘显示在纵向模式):

我可以通过以下步骤触发此问题:
创建2 UIViewController个子类:ViewControllerA和ViewControllerB
在ViewControllerA实施supportedInterfaceOrientations和返回UIInterfaceOrientationMaskPortrait
在ViewControllerB实施supportedInterfaceOrientations和返回UIInterfaceOrientationMaskLandscape
创建一个UINavigationController名为NavigationController,实现supportedInterfaceOrientations和返回的子类[self.topViewController supportedInterfaceOrientations](我这样做是因为我想保持NavigationController并且它的rootVC不能旋转)
使用NavigationController应用程序的初始视图控制器,设置ViewControllerA为NavigationController'srootViewContrller
启动应用程序,ViewControllerA将显示在Portrait中.显示一个按钮ViewControllerA,按下按钮将显示ViewControllerB使用presentViewController:animated:completion
ViewControllerB将出现在风景中; 显示文本字段ViewControllerB,点击文本字段将触发键盘,但键盘处于纵向模式,就像上面的图像一样.
PS.您可以在github上下载并运行Xcode项目
此问题似乎只出现在iOS 8.3上.难道我做错了什么 ?或许这只是iOS的另一个错误?
顺便说一句,如果你只是ViewControllerA直接显示没有a ,这个问题就不会发生ViewController.因此,如果这是iOS的错误,我怎么能避免子类化,UINavigationController但仍然保留ViewControllerA哪个是UINavigationController旋转的rootViewController .
更新:此错误仍然出现在iOS 8.4上,我在2015年6月17日发布了一个错误报告,并得到了苹果的回复,他们表示已经在最新的iOS 9测试版中解决了这个问题.
我有一个NSAttributedStringrect来绘制整个字符串,我想像下面的图片一样获取最后一个字符的rect,如何使用Core Text来获取?

我刚刚编写了一个iOS应用程序来测试UIAlertView.当我运行它时,UIAlertView只显示屏幕在没有UIAlertView的情况下变暗,并且"很长一段时间"之后,UIAlertView出现了.这在Simulator和iPhone(IOS 4.2)上都会发生.我不知道为什么,请帮助我,谢谢.
说明:(您也可以下载该项目的位置)
它是一个非常简单的基于视图的应用程序,有3个类:AppDelgate ViewControler和一个实现NSOperation的TestOperation; AppDelegate就是XCode生产的; TestOperation.h:
#import <Foundation/Foundation.h>
@protocol TestOperationDelegate
- (void)didFinishTestOperaion;
@end
@interface TestOperation : NSOperation {
id <TestOperationDelegate> delegate;
}
@property (nonatomic, assign) id <TestOperationDelegate> delegate;
@end
Run Code Online (Sandbox Code Playgroud)
TestOperation.m
#import "TestOperation.h"
@implementation TestOperation
@synthesize delegate;
- (void)main {
[delegate didFinishTestOperaion];
}
@end
Run Code Online (Sandbox Code Playgroud)
ViewContoller.m
- (void)viewDidLoad {
[super viewDidLoad];
NSOperationQueue *queue = [[NSOperationQueue alloc] init];
TestOperation *testOperation = [[TestOperation alloc] init];
testOperation.delegate = self;
[queue addOperation:testOperation];
[testOperation release];
}
- (void)didFinishTestOperaion {
NSLog(@"start uialertview");
UIAlertView *alert = …Run Code Online (Sandbox Code Playgroud) ios ×3
aqgridview ×1
cocoa-touch ×1
core-text ×1
ios4 ×1
iphone ×1
keyboard ×1
orientation ×1
uialertview ×1
uiscrollview ×1