开发中的小设置

1、将系统提示文字改为中文

很多情况下,双击UITextField系统会默认弹出Paste,copy等,还有打开相机、相册之后系统的Cancel 、Cammera等
如果想要设置成中文的话:

解决方法:

在Info.plist中添加两个属性即可

Localization native development region           China 

Localized resources can be mixed                 Yes

2、添加长按手势时,长按的方法会执行两次

解决方法:
    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPressToSavePhoto:)];
    longPress.minimumPressDuration = 0.8;
    longPress.numberOfTouchesRequired = 1;
    [self addGestureRecognizer:longPress];

- (void)longPressToSavePhoto:(UILongPressGestureRecognizer *)longPress{
if (longPress.state == UIGestureRecognizerStateBegan) {
    UIActionSheet *action = [[UIActionSheet alloc]initWithTitle:@"保存图片" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"保存", nil];
    UIWindow *window = [UIApplication sharedApplication].keyWindow;
    [action showInView:window];
}else{
}

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容