【发布时间】:2011-06-17 22:27:19
【问题描述】:
我不知道你们是否熟悉 iPad 版 Blackboard Learn 应用程序。它有弹出窗口来显示信息。
好吧,我想在 iPad 应用程序上实现类似的东西,我想知道是否可以使用 UIPopOverControllers 来实现...
基本上,您可以打开一个视图并将其拖动并保持在屏幕的边框上作为一个标签来显示更新等等。
是否可以用 UIPopOverControllers 或 UIViews 做类似的事情(拖动和标签)?
来自墨西哥的欢呼
更新 1:
好吧,我设法加载了多个 UIView,接下来可以拖动它们,有什么建议吗?
更新 2:
我尝试在 otherView.m(弹出窗口)中添加 UIPanGestureRecognizer,如下所示
otherView.h
@interface otherView : UIViewController <UIGestureRecognizerDelegate>{
UIPanGestureRecognizer *drag;
}
@property (nonatomic, retain) UIPanGestureRecognizer *drag;
...
otherView.m
- (void)viewDidLoad {
[super viewDidLoad];
// Drag
drag = [[UIPanGestureRecognizer alloc]
initWithTarget:self action:@selector(dragAction)];
[self.view addGestureRecognizer:drag];
[drag release];
}
otherView直接从appDelegate显示在mainWindow中
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch.
// Set the view controller as the window's root view controller and display.
//self.window.rootViewController = self.viewController;
[window addSubview:viewController.view];
[window addSubview:secondView.view];
[self.window makeKeyAndVisible];
return YES;
}
希望你能帮帮我
【问题讨论】:
标签: objective-c ios cocoa-touch uiview view