小编May*_*ari的帖子

Emacs:如何保持很长的包裹线的缩进级别

如果文件中的行太长而无法在屏幕上显示,我们可以使用自动换行.现在长线被分成屏幕上可见的块.

通常,代码是结构化的,并且缩进用于可读性.如果一条线被包裹成两条(或更多条)线,则只有第一条线具有右缩进,而其他线条从一行的开头开始.有没有办法保持所有包装线具有相同的缩进级别(或更一般不同的缩进级别)?

我搜索了很长时间,但仍然找不到解决方案.这个问题类似于vim的帖子,但我没有找到emacs的帖子或答案.

emacs indentation word-wrap

29
推荐指数
1
解决办法
3514
查看次数

jQuery的ajax功能在Android PhoneGap应用程序中不起作用

我想在移动应用程序中通过ajax访问开放API,它在iphone中工作正常但在Android phonegap应用程序中不起作用:

returning error->"error message-null,typeerror-Result of expression 'data'[null] is not an object and error status-parsererror"

是否需要遵循任何浏览器设置.

我想在android-phonegap应用程序中调用web服务:

$.ajax({  
   url:'stringURL',  
   beforeSend: function(x) {      
     x.setRequestHeader('Authorization','username/pwd');  
   },  
   dataType:"xml",  
   contentType:'application/xml',  
   timeout:10000,  
   type:'POST',  
   success:function(data) {  
     alert(data);  
   },  
   error:function(XMLHttpRequest,textStatus, errorThrown) {     
     alert("Error status :"+textStatus);  
     alert("Error type :"+errorThrown);  
     alert("Error message :"+XMLHttpRequest.responseXML);  
   }
});
Run Code Online (Sandbox Code Playgroud)

javascript ajax jquery android cordova

14
推荐指数
1
解决办法
7478
查看次数

如何在Objective-C中设置Http头字段?

我想在Objetive C中调用返回xml数据的Web服务,我必须将头中的一些信息传递给服务器,就像在javascript中我们可以使用jquery来做,

x.setRequestHeader( '键', '值');

其中x是xmlHttpRequest对象.我们如何在NSConnection类中传递标题数据,我使用谷歌但没有找到好的解决方案.请帮我.

iphone objective-c ios

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

如何在iPhone中将NSString转换为CGPoint

我从UITextfield获取值到NSString,需要将NSString的值转换为CGPoint,假设如果我在文本字段中输入6,5它应该将其转换为CGPoint.

iphone objective-c

12
推荐指数
1
解决办法
6665
查看次数

如何在phonegap中为iphone app设置背景图片

我是phonegap开发的新手,我正在开发一个使用phonegap框架的iphone应用项目.

我正在设置http://www.wallpaperbase.com/wallpapers/computer/mac/mac_8.jpg 图像作为我的iphone应用程序的背景,但它显示图像问题意味着图像无法正确显示在我的iphone设备上,如给定的图像示例下面.

请解决我的问题ASPS.

在此输入图像描述

请检查我的代码,让我知道它有什么问题.

html iphone cordova

11
推荐指数
1
解决办法
6563
查看次数

forward <T>(a)和(T &&)之间有什么区别(a)

template<typename T>  
void outer(T&& t) {inner(forward<T>(t));}  

template<typename T>  
void outer(T&& t) {inner((T&&)(t));}  
Run Code Online (Sandbox Code Playgroud)

有什么不同?

c++ c++11

9
推荐指数
2
解决办法
537
查看次数

如何清除vb.net中的组合框内容

如果是文本框则是textbox1.clear等等.组合框清除值的等价物是什么.

vb.net

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

jsoup http错误提取url

我只是下载最新版本的jsoup(1.7.1)并按照官方代码(更改了网址).然后我得到"http错误提取网址"

public class MainActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    try {
        loadData();
    } catch (IOException e) {
        Log.i("error",e.getMessage());
    }
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
}

public void loadData() throws IOException {
    Document doc = Jsoup.connect("http://forum.mtr.com.hk/search.php?station=30&cat=&x=25&y=2").get();
    String title = doc.title();
    Log.i("title",title);
}}
Run Code Online (Sandbox Code Playgroud)

我的代码有什么问题?似乎错误只是在Android项目中发生,因为我在Java项目中做同样的事情,工作正常.

注意: - 我已经添加了Internet权限

android jsoup

8
推荐指数
1
解决办法
5923
查看次数

iOS:通过捏缩放UITextView?

我有兴趣创建UITextView在键入文本时动态扩展,并在用户捏住屏幕时进行缩放(类似的行为可以在TinyPost中找到).

当你输入(没有捏)时,textView扩展正常.当你只是捏(没有打字)工作正常,但当你捏然后键入,内部文本被削减.

这是我的代码:

UIPinchGestureRecognizer *pinchGestRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(scaleTextView:)];
        pinchGestRecognizer.delegate = self;
        [bgFrameImageView addGestureRecognizer:pinchGestRecognizer];

    - (void)scaleTextView:(UIPinchGestureRecognizer *)pinchGestRecognizer{
        createTextView.transform = CGAffineTransformScale(createTextView.transform, pinchGestRecognizer.scale, pinchGestRecognizer.scale);

        pinchGestRecognizer.scale = 1;        
    }

    - (void)textViewDidChange:(UITextView *)textView{

        CGSize textSize = textView.contentSize;

        textView.frame = CGRectMake(CGRectGetMinX(textView.frame), CGRectGetMinY(textView.frame), textSize.width, textSize.height); //update the size of the textView  
    }
Run Code Online (Sandbox Code Playgroud)

你怎么看?

iphone uitextview uigesturerecognizer ios uipinchgesturerecognizer

8
推荐指数
1
解决办法
7919
查看次数

在UIView子类中使用的CAShapeLayer不起作用

我尝试了几个小时用CAShapeLayer在我的UIView周围画一个虚线边框,但是我没有显示它.
ScaleOverlay.h

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>

@interface ScaleOverlay : UIView <UIGestureRecognizerDelegate> {
    CAShapeLayer *shapeLayer_;
}
@end
Run Code Online (Sandbox Code Playgroud)

ScaleOverlay.m

- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
    self.backgroundColor = [UIColor redColor];
    self.alpha = 0;
    //Round corners
    [[self layer] setCornerRadius:8.f];
    [[self layer] setMasksToBounds:YES];
    //Border
    shapeLayer_ = [[CAShapeLayer layer] retain];

    CGMutablePathRef path = CGPathCreateMutable();
    CGPathAddRect(path, NULL, frame);
    shapeLayer_.path = path;
    CGPathRelease(path);
    shapeLayer_.backgroundColor = [[UIColor clearColor] CGColor];
    shapeLayer_.frame = frame;
    shapeLayer_.position = self.center;

    [shapeLayer_ setValue:[NSNumber numberWithBool:NO] forKey:@"isCircle"];
    shapeLayer_.fillColor = [[UIColor blueColor] CGColor];
    shapeLayer_.strokeColor …
Run Code Online (Sandbox Code Playgroud)

iphone core-animation ios

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