小编use*_*901的帖子

iOS从UIWebview内容创建pdf

在我的iOS应用程序中,我需要从我的webview内容创建一个pdf文档.我看了这些帖子:从UIWebView创建PDF文件https://coderchrismills.wordpress.com/2011/06/25/making-a-pdf-from-a-uiwebview/

我想知道是否有更简单的方法.例如,对于我的Mac项目,我使用:

NSData *pdf = [[[[webView mainFrame] frameView] documentView] dataWithPDFInsideRect:[[[webView mainFrame] frameView] documentView].frame];
PDFDocument *doc = [[PDFDocument alloc] initWithData:pdf];
Run Code Online (Sandbox Code Playgroud)

在iOS中有没有简单的方法可以做到这一点?

哪个是从webview内容中获取最佳质量pdf文档的最佳选择?

pdf uiwebview ios

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

iOS 7改变了pushviewcontroller的动画方向

当我推动一个视图控制器时,动画总是从右到左.我想将该动画从左向右反转.我尝试过这段代码但不起作用.动画仍然是从右到左.我怎样才能简单而正确地实现这一目标?需要帮助.提前致谢.

//NOT WORKING
myViewController *mController = [self.storyboard instantiateViewControllerWithIdentifier:@"myViewController"];

CATransition *transition = [CATransition animation];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;

[self.view.layer addAnimation:transition forKey:nil];

[self.navigationController pushViewController:mController animated:YES];
Run Code Online (Sandbox Code Playgroud)

animation push direction ios

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

Cocoa osx NSTableview改变行高亮颜色

在我的应用程序中,我有一个基于NSTableView的视图,其中包含一列.行的突出显示颜色设置为常规(蓝色).我需要将该颜色更改为我的自定义颜色.在界面构建器中,我尝试更改它,但唯一的选项是"无,常规和源列表".

我试过这个解决方案但没有成功:https: //stackoverflow.com/a/9594543/3065901

我读到我必须使用这个委托方法,但我不知道如何使用它.

- (NSTableRowView *)tableView:(NSTableView *)tableView rowViewForRow:(NSInteger)row
Run Code Online (Sandbox Code Playgroud)

我尝试在该方法中绘制行,但是我得到了无效的上下文警告,并且该行仍然保持相同的higlight.请发布一个如何使用此委托方法的简单示例:

需要帮助.提前致谢.

macos cocoa colors highlight nstableview

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

Html在onchange事件中选择多个get all值

我有一个选择倍数的表单.我想在onc​​hange事件中获取所有选定的值,但我不知道这是否可行.我认为"this.value"只返回选中的最后一个元素.

是否有可能在onchange上将所有元素选为数组?

提前致谢.

<select name="myarray[]" id="myarray" class="select2-select req" style="width: 90%;" onChange="get_values(this.value)" multiple>
    {foreach key=key item=value from=$myarray}
         <option value="{$key}" >{$value}</option>
    {/foreach}
</select>
Run Code Online (Sandbox Code Playgroud)

html javascript select onchange multi-select

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

iOS ICloud Core Data从应用程序开启

在我的iOS应用程序中,我已将数据库设置为与iCloud同步.当我插入新记录时,数据已正确更新,我可以在我的容器文件夹中查看它.现在我想设置一个开关,让用户在app运行时启用或禁用iCloud核心数据同步过程,但我不知道该怎么做.

我是iOS和ICloud的新手.需要帮助.提前致谢.

这是我在AppDelegate中的代码:

- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
    if (_persistentStoreCoordinator != nil) {
        return _persistentStoreCoordinator;
    }

    NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"myStore.sqlite"];    
    NSURL *cloudRootURL=[fileManager URLForUbiquityContainerIdentifier:nil];

    NSString *pathToCloudFile = [[cloudRootURL path]stringByAppendingPathComponent:@"Documents"];
    pathToCloudFile = [pathToCloudFile stringByAppendingPathComponent:@"myCloudLogs"];

    NSURL *cloudURL = [NSURL fileURLWithPath:pathToCloudFile];

    NSString *cloudStoreTitle = @"myStoreCloud";
    NSDictionary *options = @{NSMigratePersistentStoresAutomaticallyOption : @YES,
                          NSInferMappingModelAutomaticallyOption : @YES,
                          NSPersistentStoreUbiquitousContentURLKey: cloudURL,
                          NSPersistentStoreUbiquitousContentNameKey: cloudStoreTitle};

    NSError *error = nil;
    _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];


   if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error]) {

       //Replace this implementation with code to handle …
Run Code Online (Sandbox Code Playgroud)

core-data uiswitch ios icloud

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

用于 OS X Cocoa 的图像选择器或文件选择器

在我的应用程序中,我需要从文件系统中获取图像。我知道如何在 iOS 中做到这一点,但不知道如何在 OS X 中做到这一点。 OS X 有没有像 imagePicker 或文件选择器这样的工具?需要帮助请。

在 iOS 中我使用这个:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
Run Code Online (Sandbox Code Playgroud)

提前致谢!

macos cocoa image

3
推荐指数
1
解决办法
2635
查看次数

NSTableView 对齐调整列大小

我需要创建一个包含 3 列的 NSTableView,这些列必须适合这样的空间:20% 60% 20%。我在界面生成器中设置了约束,但没有成功。结果总是一样的。显示了 3 列,但大小与 IB 中的大小相同,如果我调整窗口大小,表格也会调整大小,但列保持原始大小。如何根据表格视图大小按比例调整列大小?如何将一列始终右对齐?需要帮助请。我的项目是针对 OS X,而不是 iPhone。提前致谢。

macos resize alignment multiple-columns nstableview

3
推荐指数
1
解决办法
2177
查看次数