草庐IT

touch-action

全部标签

ios - 如何使用 Xcode 在导航栏中添加一个共享按钮的 Action

我正在尝试向导航栏中的共享按钮添加一个操作,但我不知道如何以及在何处定义我的“shareAction”方法。要添加分享按钮,我在viewWillAppear中有以下代码:UIBarButtonItem*shareButton=[[UIBarButtonItemalloc]initWithBarButtonSystemItem:UIBarButtonSystemItemActiontarget:selfaction:@selector(shareAction:)];self.navigationItem.rightBarButtonItem=shareButton;

iphone - 带有自定义 View 的 UIButton - addTarget :action:forControlEvents: does not work

我的按钮如下创建标签1创建标签2创建自定义View(UIView)在自定义View上添加了label1和label2创建了myCustomButton(UIButton)在myCustomButton上添加了自定义View我已经为custom_View、label1和label2完成了userInteractionEnable。然后添加[myCustomButtonaddTarget:selfaction:@selector(OnButtonClick:)forControlEvents:UIControlEventTouchUpInside];和-(void)OnButtonClic

ios - Touch ID API 响应速度很慢

我已遵循指南以及Apple文档中的TouchIDAPI示例。我在我的应用程序中使用了这个例子。我可以使用TouchID登录。但问题是它的响应速度非常非常慢。将手指放在TouchID上后,我必须等待至少10秒才能验证成功/失败。我已经使用了应用程序委托(delegate)文件中的代码。我也用不同的应用程序进行了测试,但结果是相同的“延迟响应”。在这种情况下,伙计们请帮助我。 最佳答案 LAContext*myContext=[[LAContextalloc]init];NSError*authError=nil;NSString*my

ios - 如何判断 Cocoa Touch 设备是否可以调用电话?

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:iOS-Detectingwhetherornotdevicesupportphonecalls?我正在编写一个iPhone应用程序,它提供一个按钮来调用电话号码。我正在使用如下代码以通常方式使用tel:URL调用号码:NSURL*contactTelURL=[NSURLURLWithString:[NSStringstringWithFormat:@"tel:%@",contactTel]];[[UIApplicationsharedApplication]openURL:contactTelURL];它在

cocoa-touch - UIScrollView - 减速时捕捉控制

UIScrollView有很多信息可供程序员使用,但我没有看到一种明显的方法来控制控件从滚动手势减速后停止的位置。基本上我希望ScrollView捕捉到屏幕的特定区域。用户仍然可以像往常一样滚动,但是当他们停止滚动时,View应该捕捉到最相关的位置,并且在轻弹手势的情况下,减速也应该在这些位置停止。有没有简单的方法来做这样的事情,或者我应该考虑实现这种效果的唯一方法是编写自定义滚动控件? 最佳答案 由于UITableView是UIScrollView的子类,您可以实现UIScrollViewDelegate方法:-(void)scr

cocoa-touch - 为什么我的 CGGradient 不能使用预设的 UIColor?

我有这个工作代码:NSMutableArray*shadowColors=[NSMutableArrayarrayWithCapacity:2];color=[UIColorcolorWithRed:0green:0blue:0alpha:1];//Declarationusingcomponents[shadowColorsaddObject:(id)[colorCGColor]];color=[UIColorcolorWithRed:1green:1blue:1alpha:0.0];//Declarationusingcomponents[shadowColorsaddObject

ios - 从静态库构建 Cocoa Touch 动态框架不会产生二进制文件

我正在尝试使用此处描述的方法2从header和静态库将GoogleMobileAds构建为动态框架:https://pewpewthespells.com/blog/convert_static_to_dynamic.html我已经建立了一个项目,它构建成功,但是生成的框架不包含二进制文件,只包含header。关于我做错了什么的任何想法?示例项目:https://github.com/HiveHicks/GoogleMobileAds-Dynamic-Wrapper附言使用XCode8.1构建 最佳答案 如果项目中没有.m文件,XC

iphone - 如何在 Action Sheet 中添加日期选择器?

-(IBAction)showCatPicker{if(self.catList!=nil){self.catList=nil;[catListrelease];}self.catList=[[NSMutableArrayalloc]init];self.actionSheet=[[UIActionSheetalloc]initWithTitle:nildelegate:nilcancelButtonTitle:nildestructiveButtonTitle:nilotherButtonTitles:nil];[self.actionSheetsetActionSheetStyle

cocoa-touch - 使 UIAlertView 阻塞

我需要让UIAlertView阻塞。因为我有功能,我需要返回UIAlertView选择。但问题是,在显示UIAlertView之后,我的函数代码正在进一步执行,所以我无法捕捉到UIAlertView选择(我可以在委托(delegate)方法中做到这一点,但我需要返回函数结果)。我尝试使用NSCondition阻止UIAlertVIew。但是代码不起作用。condition=[NSConditionnew];result=0;[conditionlock];UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@"Fingerprint"m

ios - UIButton 触摸 Action 不在触摸时调用但在触摸移动时调用

当用户按下UIButton时需要执行一个Action[buttonaddTarget:selfaction:@selector(touchDown:event:)forControlEvents:UIControlEventTouchDown];[buttonaddTarget:selfaction:@selector(drag:event:)forControlEvents:UIControlEventTouchDragInside];[buttonaddTarget:selfaction:@selector(drag:event:)forControlEvents:UIContro