美文网首页
开发中的小设置

开发中的小设置

作者: ibiaoma | 来源:发表于2016-11-05 14:21 被阅读30次

    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{
    }
    

    }

    相关文章

      网友评论

          本文标题:开发中的小设置

          本文链接:https://www.haomeiwen.com/subject/frghyttx.html