草庐IT

Davids-iPhone

全部标签

iphone - 如何将按钮添加到 QLPreviewController

是否可以将新按钮添加到工具栏或QLpreviewController右上角的actionButton中?如果是,我该如何编写代码? 最佳答案 尽管QLPreviewController是UIViewController的子类,但更改导航项没有任何效果。例如,这段代码理论上应该可以工作,但实际上并没有:QLPreviewController*previewController=[[QLPreviewControlleralloc]init];previewController.navigationItem.rightBarButton

iphone - 带参数的 UIBarButtonItem 操作

我遇到了一些问题,我需要添加一个调用名为“valider”的方法的UIBarButtonItem-(void)valider:(NSString*)firstParam{NSLog(@"Logs%@",firstParam);}我像这样创建我的UIBarButtonItem,但我需要传递我的第一个参数!UIBarButtonItem*buttonValiderAddSerie=[[UIBarButtonItemalloc]initWithTitle:@"Valider"style:UIBarButtonItemStyleBorderedtarget:selfaction:@select

iphone - 如何更改导航栏高度

这个问题困扰了我一天多。我需要修改UINavigationBar的高度。UINavigationController是这样在AppDelegate中创建的。self.navigationController=[[UINavigationControlleralloc]initWithRootViewController:mainController];[self.windowaddSubview:self.navigationController.view];[self.windowmakeKeyAndVisible];如果我将[self.navigationController.na

iphone - 中英文本地化申请

我正在创建一个应用程序,我想在其中使用两种语言进行本地化:1)英语2)中文我用一种简单的本地化方法完成了整个应用程序,它对我来说效果很好。但现在的问题是,如果用户通过应用程序中的语言选择选项选择他/她的语言作为中文或英文,它将根据语言转换整个应用程序而无需退出或重新启动应用程序。有什么建议吗??? 最佳答案 这是可能的而且很容易,看看HowtoforceNSLocalizedStringtouseaspecificlanguage 关于iphone-中英文本地化申请,我们在StackOv

iphone - 将 UINibExternalObjects 注入(inject)到自初始化的 ViewController

我想从一个ViewController导航到另一个。作为其中的一部分,我想通过ViewController我想导航到一些信息。我封装了信息到我想作为外部对象与目标Hook的对象中ViewController。我在IB中创建了外部对象,并为其提供了我在传递给NibLoading方法的NSDictionary中引用的标识符。NSArray*topLevelObjs=nil;NSMutableDictionary*options=[[NSMutableDictionaryalloc]initWithCapacity:1];NSMutableDictionary*config=[[NSMuta

iphone - touchesBegan - iPhone 应用程序 UIView

我有一个touchesBegan:方法,它工作正常。然而,我最近向我的UIViewController添加了一个UIView(一个按钮),现在该按钮没有注册点击,但是我的touchesBegan:方法是。如何让我的touchesBegan:方法避开按钮?这是我当前的touchesBegan:方法:-(void)touchesBegan:(NSSet*)toucheswithEvent:(UIEvent*)event{NSLog(@"touchesbegan");UITouch*touch=[touchesanyObject];switch([touchtapCount]){case1:

iphone - 如何在方向更改后调整 UIView 的大小(包含的代码似乎不起作用)

为什么这个UIView布局代码不能像我想要的那样工作?背景:我的UIViewController中有一个自定义UIView自定义UIView有一个时钟背景ImageView和一个时针ImageView在引入一些代码(见下文)以尝试调整时针的大小以进行方向更改后,我遇到了困难。下面的代码确实把事情搞砸了——沙漏指针的边框与这段代码相去甚远任何想法我做错了什么-显然有一些假设或误解我必须让它像这样搞砸......UIViewController调用的代码(在“didRotateFromInterfaceOrientation”方法中)到我的自定义View://Centreimageself

iphone - Facebook Graph API(向人们介绍我的应用程序)

是否可以使用GraphAPI向我的friend介绍该应用程序?我翻阅了文档,但找不到任何内容,也许我错过了。我可以看到我可以在我的墙上发帖,但与共享链接/应用程序无关。谢谢 最佳答案 共享链接是图谱API的一部分。您可以向Post请求添加很多变量。请在此处查看官方文档:http://developers.facebook.com/docs/reference/api/post/例如,我将消息、链接、名称、标题、描述和图标属性与图形API结合使用来创建此对话框(使用FacebookiOSSDK)。

iphone - UIImagePickerController ios 5 在 ipad 中使用 UIPopoverController 选择图像时出现问题

我在ios5的ipad中从UIImagePickerController选择图像时遇到问题。相同的代码在ios4中完美运行。那么问题是什么?任何人都可以帮助我如何在ios5中使用UIImagePickerController吗?ios4和ios5的UIImagePickerController有什么区别吗?下面是问题的代码。-(IBAction)selectExitingPicture:(id)sender{if([popoverControllerisPopoverVisible]){[popoverControllerdismissPopoverAnimated:YES];[pop

ios - 将加速度计数据记录到 Iphone IOS 上的文件中

您好,我正在尝试将加速度计数据写入文件。这是我的代码:-(void)accelerometer:(UIAccelerometer*)accelerometerdidAccelerate:(UIAcceleration*)acceleration{//xax.text=[NSStringstringWithFormat:@"X:[%2.6f]",acceleration.x];//yax.text=[NSStringstringWithFormat:@"Y:[%2.6f]",acceleration.y];//zax.text=[NSStringstringWithFormat:@"Z: